Skip to content

Instantly share code, notes, and snippets.

@tomhodgins
Created August 22, 2019 18:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomhodgins/31ddd12d444f029667ac163a918de030 to your computer and use it in GitHub Desktop.
Save tomhodgins/31ddd12d444f029667ac163a918de030 to your computer and use it in GitHub Desktop.
Paste this rule in your browser's JS console on a loaded web page to log all rules targeting <option> tags. Change the text 'option' in the regex on line 7 to something else to filter for a different tag
import ('https://unpkg.com/cssomtools') .then(
({stringify, filter, all}) =>
console.log(
stringify(
filter(
all(),
rule => rule.selectorText && /\boption\b/.test(rule.selectorText)
)
)
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment