diff --git a/fr/script.js b/fr/script.js index 7d37843..df835f8 100644 --- a/fr/script.js +++ b/fr/script.js @@ -41,6 +41,19 @@ function change_font() let content = Array.from(document.styleSheets); console.log(content); */ + // get all the styleSheets + const styleSheets = Array.from(document.styleSheets); + + styleSheets.forEach(styleSheet => { + const cssRules = styleSheet.cssRules; + + // all the font-faces rules + const rulesFontFace = cssRules.filter(rule => rule.cssText.startsWith('@font-face')); + + rulesFontFace.forEach(fontFace => { + console.log(fontFace); // CSSFontFaceRule object + }); + }); }