File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
plugins/optimization-detective Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -244,7 +244,7 @@ async function getAlreadySubmittedSessionStorageKey(
244
244
urlMetricGroupStatus ,
245
245
{ warn, error }
246
246
) {
247
- if ( ! window . crypto || ! window . crypto . subtle ) {
247
+ if ( ! win . crypto || ! win . crypto . subtle ) {
248
248
warn (
249
249
'Unable to generate sessionStorage key for already-submitted URL since crypto is not available, likely due to to the page not being served via HTTPS.'
250
250
) ;
@@ -580,7 +580,7 @@ export default async function detect( {
580
580
return ;
581
581
}
582
582
583
- if ( document . visibilityState === 'hidden' && ! document . prerendering ) {
583
+ if ( doc . visibilityState === 'hidden' && ! doc . prerendering ) {
584
584
log ( 'Page opened in background tab so URL Metric is not collected.' ) ;
585
585
return ;
586
586
}
@@ -671,7 +671,7 @@ export default async function detect( {
671
671
672
672
// Keep track of whether the window resized. If it was resized, we abort sending the URLMetric.
673
673
let didWindowResize = false ;
674
- window . addEventListener (
674
+ win . addEventListener (
675
675
'resize' ,
676
676
( ) => {
677
677
didWindowResize = true ;
@@ -927,7 +927,7 @@ export default async function detect( {
927
927
doc . addEventListener (
928
928
'visibilitychange' ,
929
929
( ) => {
930
- if ( document . visibilityState === 'hidden' ) {
930
+ if ( doc . visibilityState === 'hidden' ) {
931
931
// TODO: This will fire even when switching tabs.
932
932
resolve ( ) ;
933
933
}
You can’t perform that action at this time.
0 commit comments