* * Unlike other drivers Puppeteer changes the size of a viewport, not the window! * Puppeteer does not control the window of a browser, so it can't adjust its real size. * It also can't maximize a window. * * {{> resizeWindow }} *
(width, height)
| 793 | * |
| 794 | */ |
| 795 | async resizeWindow(width, height) { |
| 796 | if (width === 'maximize') { |
| 797 | throw new Error("Puppeteer can't control windows, so it can't maximize it") |
| 798 | } |
| 799 | |
| 800 | await this.page.setViewport({ width, height }) |
| 801 | return this._waitForAction() |
| 802 | } |
| 803 | |
| 804 | /** |
| 805 | * Set headers for all next requests |
no test coverage detected