Uh oh!
There was an error while loading. Please reload this page.
feat(browsercontext): mirror Page lifecycle events on BrowserContext - #40341
Conversation
Adds BrowserContext-level events that mirror existing Page events, so users can subscribe once at the context level instead of wiring listeners per page: - BrowserContext.pageload -> Page.load - BrowserContext.pageclose -> Page.close - BrowserContext.framenavigated -> Page.frameNavigated - BrowserContext.frameattached -> Page.frameAttached - BrowserContext.framedetached -> Page.frameDetached - BrowserContext.download -> Page.download
08ee49a
into
microsoft:mainUh oh!
There was an error while loading. Please reload this page.
Test results for "tests 1"6 flaky41306 passed, 847 skipped Merge workflow run. |
Test results for "MCP"3 failed 6546 passed, 913 skipped Merge workflow run. |
Ports the following upstream client-side PRs: - microsoft/playwright#39767 - feat: Add `location()` to `WebError` - microsoft/playwright#39950 - feat: page version of toMatchAriaSnapshot - microsoft/playwright#40083 - feat(locator): add `description` option to getByRole - microsoft/playwright#40092 - feat(expect): support pseudo-element in toHaveCSS - microsoft/playwright#40159 - feat(tracing): add tracing.startHar / tracing.stopHar - microsoft/playwright#40196 - chore: remove deprecated `handle` option from exposeBinding - microsoft/playwright#40215 - feat(api): Locator.highlight({ style }) - microsoft/playwright#40219 - feat(api): Page.hideHighlight, Locator.hideHighlight, highlight() returns AutoCloseable - microsoft/playwright#40283 - feat(locator): add drop API for files and clipboard-like data - microsoft/playwright#40315 - feat(browser): Browser.onContext / offContext - microsoft/playwright#40341 - feat(browsercontext): mirror Page lifecycle events on BrowserContext - microsoft/playwright#40377 - feat(route): expose WebSocket subprotocols on WebSocketRoute - microsoft/playwright#40606 - feat(api): unify WebError and ConsoleMessage location - microsoft/playwright#40651 - docs: alias drop-payload Object types Protocol shape change for FrameExpectResult.received (now `{ value, ariaSnapshot }` instead of a bare SerializedValue) — updated AssertionsBase to unwrap it. Generator updates: added new types to relevant import lists; share topLevelTypes between the assertion and non-assertion generate runs so PseudoElement gets emitted into options/.
Ports the following upstream client-side PRs: - microsoft/playwright#39767 - feat: Add `location()` to `WebError` - microsoft/playwright#39950 - feat: page version of toMatchAriaSnapshot - microsoft/playwright#40083 - feat(locator): add `description` option to getByRole - microsoft/playwright#40092 - feat(expect): support pseudo-element in toHaveCSS - microsoft/playwright#40159 - feat(tracing): add tracing.startHar / tracing.stopHar - microsoft/playwright#40196 - chore: remove deprecated `handle` option from exposeBinding - microsoft/playwright#40215 - feat(api): Locator.highlight({ style }) - microsoft/playwright#40219 - feat(api): Page.hideHighlight, Locator.hideHighlight, highlight() returns AutoCloseable - microsoft/playwright#40283 - feat(locator): add drop API for files and clipboard-like data - microsoft/playwright#40315 - feat(browser): Browser.onContext / offContext - microsoft/playwright#40341 - feat(browsercontext): mirror Page lifecycle events on BrowserContext - microsoft/playwright#40377 - feat(route): expose WebSocket subprotocols on WebSocketRoute - microsoft/playwright#40606 - feat(api): unify WebError and ConsoleMessage location - microsoft/playwright#40651 - docs: alias drop-payload Object types Protocol shape change for FrameExpectResult.received (now `{ value, ariaSnapshot }` instead of a bare SerializedValue) — updated AssertionsBase to unwrap it. Generator updates: added new types to relevant import lists; share topLevelTypes between the assertion and non-assertion generate runs so PseudoElement gets emitted into options/.
Summary
Adds
BrowserContext-level events that mirror existingPageevents, so users can subscribe once on the context instead of wiring listeners per page.New events (all
since: v1.60):BrowserContext.pageload— mirrorsPage.loadBrowserContext.pageclose— mirrorsPage.closeBrowserContext.framenavigated— mirrorsPage.frameNavigatedBrowserContext.frameattached— mirrorsPage.frameAttachedBrowserContext.framedetached— mirrorsPage.frameDetachedBrowserContext.download— mirrorsPage.downloadClient-side only fan-out next to the existing
Pageemits — no protocol or dispatcher changes.