Skip to content

Commit b4f1172

Browse files
committed
Restore viewport capturing to its original location
1 parent 5c3e698 commit b4f1172

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

plugins/optimization-detective/detect.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,6 @@ function recursiveFreeze( obj ) {
127127
Object.freeze( obj );
128128
}
129129

130-
// This needs to be captured early in case the user later resizes the window.
131-
const viewport = {
132-
width: win.innerWidth,
133-
height: win.innerHeight,
134-
};
135-
136130
/**
137131
* URL Metric being assembled for submission.
138132
*
@@ -489,7 +483,10 @@ export default async function detect( {
489483

490484
urlMetric = {
491485
url: currentUrl,
492-
viewport,
486+
viewport: {
487+
width: win.innerWidth,
488+
height: win.innerHeight,
489+
},
493490
elements: [],
494491
};
495492

0 commit comments

Comments
 (0)