Fix navigation to about:blank

This patch fixes navigation to about:blank url.
This commit is contained in:
Andrey Lushnikov
2017-07-28 16:44:51 -07:00
parent 26d97bbe3e
commit bd767002bb
3 changed files with 10 additions and 1 deletions

View File

@@ -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);