plumb reason upon pipe closing

This commit is contained in:
Simon Knott 2024-08-01 16:13:03 +02:00
parent 2e20ac19b2
commit 368f3a206b
No known key found for this signature in database
GPG key ID: 8CEDC00028084AEC

View file

@ -148,8 +148,8 @@ export class BrowserType extends ChannelOwner<channels.BrowserTypeChannel> imple
// Emulate all pages, contexts and the browser closing upon disconnect. // Emulate all pages, contexts and the browser closing upon disconnect.
for (const context of browser?.contexts() || []) { for (const context of browser?.contexts() || []) {
for (const page of context.pages()) for (const page of context.pages())
page._onClose(); page._onClose(reason);
context._onClose(); context._onClose(reason);
} }
connection.close(reason || closeError); connection.close(reason || closeError);
// Give a chance to any API call promises to reject upon page/context closure. // Give a chance to any API call promises to reject upon page/context closure.