Posts

Showing posts with the label devtools javascript css automation open-source frontend

Show HN: A DevTools-Level JavaScript API for DOM and CSS Style Rules https://ift.tt/o1wCqX8

Image
Show HN: A DevTools-Level JavaScript API for DOM and CSS Style Rules It is a wrapper around the Chrome DevTools Protocol (CDP), the same API that DevTools uses, to inspect elements programmatically and intuitively, like accessing DOM. Why this? I have seen too many tools pretending they can get matched CSS style rules but actually only computed styles. The real DevTools data—CSS rules, selectors, and cascading order—is what we want to retrieve programmatically, yet CDP is hard to use, full of undocumented quirks. One has to observe Devtools' behavior and check the huge DevTools frontend codebase to know how to use it. Having worked on a Chromium fork before, I feel it is time to solve this once and for all. What can we build around this? That's what I'd love to ask you all. Probably like many, MCP was what came to my mind first, but then I wondered that given this simple API, maybe agents could just write scripts directly? Need opinions. My own use case was CSS inlining. Th...