File tree Expand file tree Collapse file tree 2 files changed +10
-11
lines changed
Expand file tree Collapse file tree 2 files changed +10
-11
lines changed Original file line number Diff line number Diff line change 102102 //# sourceURL=sw.inline.js
103103 </ script >
104104
105- < script src =/js/obs.speedcurve.js?v =0004 type=module> </ script >
105+ < script src =/js/obs.speedcurve.js?v =0005 type=module> </ script >
Original file line number Diff line number Diff line change 7272 }
7373 }
7474
75- /**
76- * Compute new ‘First Potential Paint’ (FPP) metric. This is the time,
77- * relative to navigation start, at which the browser finished parsing the
78- * `<head>` and could potentially start rendering the `<body>`.
79- */
80- const navEntry = performance . getEntriesByType ( 'navigation' ) [ 0 ] ;
81- const headEndMark = performance . getEntriesByName ( 'HEAD_End' ) [ 0 ] ;
82- const fpp = headEndMark . startTime - navEntry . startTime ;
83- // Assign FPP to a new `measure`.
84- performance . measure ( 'fpp' , { start : navEntry . startTime , end : headEndMark . startTime } ) ;
75+ // First Potential Paint (FPP)
76+ if ( navigation . startTime >= 0 ) {
77+ const headEnd = performance . getEntriesByName ( 'HEAD_End' ) [ 0 ] ;
78+ const fpp = Math . round ( headEnd . startTime - navigation . startTime ) ;
79+ if ( Number . isFinite ( fpp ) && fpp >= 0 ) {
80+ LUX . addData ( 'fpp' , fpp ) ;
81+ }
82+ }
83+
8584
8685} ) ( ) ;
You can’t perform that action at this time.
0 commit comments