We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 47eef00 commit e39b86aCopy full SHA for e39b86a
plugins/optimization-detective/detect.js
@@ -422,6 +422,11 @@ export default async function detect( {
422
return;
423
}
424
425
+ if ( document.visibilityState === 'hidden' && ! document.prerendering ) {
426
+ log( 'Page opened in background tab so URL Metric is not collected.' );
427
+ return;
428
+ }
429
+
430
// Abort if the current viewport is not among those which need URL Metrics.
431
const urlMetricGroupStatus = getGroupForViewportWidth(
432
win.innerWidth,
0 commit comments