Skip to content

Commit

Permalink
Workaround for puppeteer/puppeteer#1183 (#1007)
Browse files Browse the repository at this point in the history
* Workaround for puppeteer/puppeteer#1183

* Formatting.

* Formatting.
  • Loading branch information
gavoja authored and DavertMik committed Mar 30, 2018
1 parent e8a76ab commit a58d0c5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/helper/Puppeteer.js
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,13 @@ class Puppeteer extends Helper {
if (width === 'maximize') {
throw new Error('Puppeteer can\'t control windows, so it can\'t maximize it');
}

// Workaround for https://github.com/GoogleChrome/puppeteer/issues/1183
await this.browser._connection.send('Browser.setWindowBounds', {
bounds: { height, width },
windowId: 1, // Use the first window.
});

await this.page.setViewport({ width, height });
return this._waitForAction();
}
Expand Down

0 comments on commit a58d0c5

Please sign in to comment.