Skip to content

Commit

Permalink
Restore viewport capturing to its original location
Browse files Browse the repository at this point in the history
  • Loading branch information
westonruter committed Dec 3, 2024
1 parent 5c3e698 commit b4f1172
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions plugins/optimization-detective/detect.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,6 @@ function recursiveFreeze( obj ) {
Object.freeze( obj );
}

// This needs to be captured early in case the user later resizes the window.
const viewport = {
width: win.innerWidth,
height: win.innerHeight,
};

/**
* URL Metric being assembled for submission.
*
Expand Down Expand Up @@ -489,7 +483,10 @@ export default async function detect( {

urlMetric = {
url: currentUrl,
viewport,
viewport: {
width: win.innerWidth,
height: win.innerHeight,
},
elements: [],
};

Expand Down

0 comments on commit b4f1172

Please sign in to comment.