Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var resources = window.performance.getEntries("resource");
- var blocking = resources.filter(function(entry){
- return entry.initiatorType == 'script' || entry.initiatorType == 'link' || entry.initiatorType == 'css' ;
- });
- var syncronous = blocking.filter(function(entry){
- let interactive = window.performance.timing.domInteractive - window.performance.timing.fetchStart;
- return entry.startTime < interactive;
- });
- var maxTime = Math.max(...syncronous.map(o => o.responseEnd), 0);
- console.log("DOM Interactive at: " + maxTime);
Add Comment
Please, Sign In to add comment