File tree Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -263,16 +263,18 @@ console.log('Fonts and Weights Loaded in the Document')
263263loadedFonts .forEach (font  =>  console .log (` ▸ ${ font} ` 
264264console .log (' ' 
265265
266- const  aboveFoldElements  =  Array .from (document .querySelectorAll (' body > *:not(script):not(style)' filter (el  =>  {
267-  const  rect  =  el .getBoundingClientRect ();
268-  return  (
269-  rect .top  >=  0  && 
270-  rect .left  >=  0  && 
271-  rect .bottom  <=  (window .innerHeight  ||  document .documentElement .clientHeight ) && 
272-  rect .right  <=  (window .innerWidth  ||  document .documentElement .clientWidth )
273-  );
274- });
275- const  usedFonts  =  Array .from (new  Set ([... aboveFoldElements].map (e  =>  ` ${ getComputedStyle (e).fontFamily } ${ getComputedStyle (e).fontWeight } ` 
266+ const  childrenSlector  =  ' body * > *:not(script):not(style):not(link):not(source)' 
267+ const  aboveFoldElements  =  Array .from (document .querySelectorAll (childrenSlector)).filter (elm  =>  {
268+  const  rect  =  elm .getBoundingClientRect ();
269+  return  (
270+  rect .top  >=  0  && 
271+  rect .left  >=  0  && 
272+  rect .bottom  <=  (window .innerHeight  ||  document .documentElement .clientHeight ) && 
273+  rect .right  <=  (window .innerWidth  ||  document .documentElement .clientWidth )
274+  )
275+  })
276+ 
277+ const  usedFonts  =  Array .from (new  Set ([... aboveFoldElements].map (e  =>  ` ${ getComputedStyle (e).fontFamily } ${ getComputedStyle (e).fontWeight } ${ getComputedStyle (e).fontStyle } ` 
276278
277279console .log (' Fonts and Weights Used Avobe the Fold' 
278280usedFonts .forEach (font  =>  console .log (` ▸ ${ font} ` 
                         You can’t perform that action at this time. 
           
                  
0 commit comments