Skip to content

Instantly share code, notes, and snippets.

@brendanmoore
Last active March 20, 2019 10:50
Show Gist options
  • Save brendanmoore/0590a2ddae31ea6185e8cb1a405ecf7c to your computer and use it in GitHub Desktop.
Save brendanmoore/0590a2ddae31ea6185e8cb1a405ecf7c to your computer and use it in GitHub Desktop.
Log @font-face rules for page
for (var i=0;i<document.styleSheets.length;i++) {
console.group(document.styleSheets[i].href);
for (var j=0;j<document.styleSheets[i].cssRules.length;j++)
{
var rule =document.styleSheets[i].cssRules[j];
if (rule instanceof CSSFontFaceRule) {
console.log(rule.cssText);
}
}
console.groupEnd();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment