Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Cool. I'm curious - how'd you do it? Is there any open source library to find out CSS rules?


document.stylesheets - https://developer.mozilla.org/en-US/docs/Web/API/document.st...

The main part of the injected code is https://gist.github.com/benfoxall/5647039 - there's a bit of hacking round cors issues there too.


You can use cssom (by visionmedia) and document.querySelectorAll/sizzle.


Presumably, you could take the selectors in the CSS and pass them to a JavaScript selector engine. That way, you'd automatically have a list of elements affected by each rule.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: