mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
fix(page): fix page.screenshot method (#4786)
This patch fixes page.screenshot. so that it throws correct error message when options.clip.height===0
This commit is contained in:
parent
eb44e260a9
commit
f4f21896d2
@ -879,7 +879,7 @@ class Page extends EventEmitter {
|
||||
assert(typeof options.clip.width === 'number', 'Expected options.clip.width to be a number but found ' + (typeof options.clip.width));
|
||||
assert(typeof options.clip.height === 'number', 'Expected options.clip.height to be a number but found ' + (typeof options.clip.height));
|
||||
assert(options.clip.width !== 0, 'Expected options.clip.width not to be 0.');
|
||||
assert(options.clip.height !== 0, 'Expected options.clip.width not to be 0.');
|
||||
assert(options.clip.height !== 0, 'Expected options.clip.height not to be 0.');
|
||||
}
|
||||
return this._screenshotTaskQueue.postTask(this._screenshotTask.bind(this, screenshotType, options));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user