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() {
|
||||
super._dispose();
|
||||
this._context.setRequestInterceptor(undefined).catch(() => {});
|
||||
// Avoid protocol calls for the closed context.
|
||||
if (!this._context.isClosingOrClosed())
|
||||
this._context.setRequestInterceptor(undefined).catch(() => {});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue