mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
fix(Page.goto): check navigation completeness on frame detachment (#1419)
Currently, the NavigatorWatcher ensures that all the frames in the frame subtree reach the desired lifecycle events state. For this to be fully correct, NavigatorWatcher should also check navigation status whenever frames are detached.
This commit is contained in:
parent
6512ce768d
commit
ea70ac9003
@ -43,7 +43,8 @@ class NavigatorWatcher {
|
|||||||
this._initialLoaderId = frame._loaderId;
|
this._initialLoaderId = frame._loaderId;
|
||||||
this._timeout = typeof options.timeout === 'number' ? options.timeout : 30000;
|
this._timeout = typeof options.timeout === 'number' ? options.timeout : 30000;
|
||||||
this._eventListeners = [
|
this._eventListeners = [
|
||||||
helper.addEventListener(this._frameManager, FrameManager.Events.LifecycleEvent, this._checkLifecycleComplete.bind(this))
|
helper.addEventListener(this._frameManager, FrameManager.Events.LifecycleEvent, this._checkLifecycleComplete.bind(this)),
|
||||||
|
helper.addEventListener(this._frameManager, FrameManager.Events.FrameDetached, this._checkLifecycleComplete.bind(this))
|
||||||
];
|
];
|
||||||
|
|
||||||
const lifecycleCompletePromise = new Promise(fulfill => {
|
const lifecycleCompletePromise = new Promise(fulfill => {
|
||||||
|
Loading…
Reference in New Issue
Block a user