Skip to content

Instantly share code, notes, and snippets.

@himat
Last active November 11, 2020 04:57
Show Gist options
  • Save himat/27f982b3831e2d8bdd0723626f10d95a to your computer and use it in GitHub Desktop.
Save himat/27f982b3831e2d8bdd0723626f10d95a to your computer and use it in GitHub Desktop.
[Find which page stylesheet contains a certain css text] #javascript
for (var sheetI=0; sheetI<document.styleSheets.length; sheetI+=1) {
try {
var foundRule = Array.from(document.styleSheets[sheetI].cssRules).find(rule => rule.cssText.includes(".intercom-sg4b1o"));
console.log("found? doc", sheetI, " - ", foundRule);
} catch (error) { console.log(error); }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment