Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
TypeScript automationchromechromiume2e-testingelectronend-to-end-testingfirefoxjavascriptplaywrighttesttest-automationtestingtesting-toolswebwebkit
chore: avoid protocol calls on disposed context (#16812)
Dmitry Gozman2c1723b6f5f9
diff --git a/packages/playwright-core/src/server/dispatchers/browserContextDispatcher.ts b/packages/playwright-core/src/server/dispatchers/browserContextDispatcher.tsindex d44546a046..5253e5ea31 100644--- a/packages/playwright-core/src/server/dispatchers/browserContextDispatcher.ts+++ b/packages/playwright-core/src/server/dispatchers/browserContextDispatcher.ts@@ -227,6 +227,8 @@ export class BrowserContextDispatcher extends Dispatcher<BrowserContext, channeloverride _dispose() {super._dispose();- this._context.setRequestInterceptor(undefined).catch(() => {});+ // Avoid protocol calls for the closed context.+ if (!this._context.isClosingOrClosed())+ this._context.setRequestInterceptor(undefined).catch(() => {});}}