mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
Fix navigation to about:blank
This patch fixes navigation to about:blank url.
This commit is contained in:
@@ -242,7 +242,7 @@ class Page extends EventEmitter {
|
||||
/**
|
||||
* @param {string} html
|
||||
* @param {!Object=} options
|
||||
* @return {!Promise<!Response>}
|
||||
* @return {!Promise<?Response>}
|
||||
*/
|
||||
async navigate(url, options) {
|
||||
const watcher = new NavigatorWatcher(this._client, options);
|
||||
@@ -260,6 +260,8 @@ class Page extends EventEmitter {
|
||||
}
|
||||
await result;
|
||||
helper.removeEventListeners([listener]);
|
||||
if (url === 'about:blank')
|
||||
return null;
|
||||
let response = responses.get(this.mainFrame().url());
|
||||
if (!response)
|
||||
throw new Error('Failed to navigate: ' + url);
|
||||
|
||||
Reference in New Issue
Block a user