Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

fix(chromium): fix a race when intialization does not finish before page close (#6975)

Dmitry Gozman6eeafc171b66
diff --git a/src/server/chromium/crPage.ts b/src/server/chromium/crPage.ts
index f54167df30..107537a1ed 100644
--- a/src/server/chromium/crPage.ts
+++ b/src/server/chromium/crPage.ts
@@ -482,7 +482,7 @@ class FrameSession {
// Ignore lifecycle events for the initial empty page. It is never the final page
// hence we are going to get more lifecycle updates after the actual navigation has
// started (even if the target url is about:blank).
- lifecycleEventsEnabled.then(() => {
+ lifecycleEventsEnabled.catch(e => {}).then(() => {
this._eventListeners.push(helper.addEventListener(this._client, 'Page.lifecycleEvent', event => this._onLifecycleEvent(event)));
});
} else {