mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
fix(webkit): emit close on pages before clearing them (#1386)
This commit is contained in:
parent
69be12ae12
commit
a96dec58c8
@ -68,9 +68,10 @@ export class WKBrowser extends platform.EventEmitter implements Browser {
|
||||
_onDisconnect() {
|
||||
for (const wkPage of this._wkPages.values())
|
||||
wkPage.dispose();
|
||||
this._wkPages.clear();
|
||||
for (const context of this._contexts.values())
|
||||
context._browserClosed();
|
||||
// Note: previous method uses pages to issue 'close' event on them, so we clear them after.
|
||||
this._wkPages.clear();
|
||||
this.emit(Events.Browser.Disconnected);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user