Skip to content

Commit

Permalink
Fix broken output resolution for mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
workeffortwaste committed Apr 15, 2021
1 parent 6eb3251 commit 9d7d4d1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions layout-shift-gif.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ const createGif = async (url, device) => {
// Emulate a phone or standard desktop size.
if (device === 'mobile') {
await page.emulate(phone)
await page.setViewport({
width: 412,
height: 732,
deviceScaleFactor: 1
})
// Override viewport resolution if a width or height are manually supplied
if (options.width || options.height) {
await page.setViewport({
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "layout-shift-gif",
"version": "1.1.5",
"version": "1.1.6",
"description": "Generates a .gif showing the layout shift events for a website.",
"main": "./layout-shift-gif.js",
"keywords": [
Expand Down

0 comments on commit 9d7d4d1

Please sign in to comment.