diff --git a/examples/colorwheel.js b/examples/colorwheel.js index c9bade3a..477f3ae4 100644 --- a/examples/colorwheel.js +++ b/examples/colorwheel.js @@ -21,7 +21,7 @@ browser.newPage().then(async page => { await page.setViewportSize({width: 400, height: 400}); await page.setContent('
'); await page.evaluate(drawColorWheel); - await page.saveScreenshot('colorwheel.png'); + await page.screenshot({path: 'colorwheel.png'}); browser.close(); }); diff --git a/phantom_shim/WebPage.js b/phantom_shim/WebPage.js index b4c081d4..5f98da0e 100644 --- a/phantom_shim/WebPage.js +++ b/phantom_shim/WebPage.js @@ -297,7 +297,7 @@ class WebPage { } else { var options = {}; if (this.clipRect && (this.clipRect.left || this.clipRect.top || this.clipRect.width || this.clipRect.height)) { - options.clipRect = { + options.clip = { x: this.clipRect.left, y: this.clipRect.top, width: this.clipRect.width, @@ -305,7 +305,7 @@ class WebPage { }; } options.path = fileName; - await(this._page.saveScreenshot(fileName, clipRect)); + await(this._page.screenshot(options)); } }