mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
chore: avoid protocol calls on disposed context (#16812)
Otherwise, we always get a failing protocol message when closing a context.
This commit is contained in:
parent
553ecce4f9
commit
2c1723b6f5
@ -227,6 +227,8 @@ export class BrowserContextDispatcher extends Dispatcher<BrowserContext, channel
|
|||||||
|
|
||||||
override _dispose() {
|
override _dispose() {
|
||||||
super._dispose();
|
super._dispose();
|
||||||
this._context.setRequestInterceptor(undefined).catch(() => {});
|
// Avoid protocol calls for the closed context.
|
||||||
|
if (!this._context.isClosingOrClosed())
|
||||||
|
this._context.setRequestInterceptor(undefined).catch(() => {});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user