Implementation:Microsoft Playwright WkProvisionalPage
Overview
WKProvisionalPage manages WebKit's provisional page mechanism for Cross-Origin-Opener-Policy (COOP) navigations, where a navigation starts in one process and completes in another.
Description
When WebKit encounters a COOP header that requires a process swap, it creates a provisional page in a new process. The WKProvisionalPage class manages this transition by:
- Listening for network and page events on the provisional session
- Overriding frame IDs to make events appear as if they came from the same process
- Tracking the COOP navigation request that triggered the process swap
- Forwarding relevant events to the
WKPagehandlers - Handling initialization of the new session with required protocol domains
This is a WebKit-specific concept not present in Chromium or Firefox automation.
Usage
Created internally by the WebKit browser when a COOP-triggered process swap occurs during navigation.
Code Reference
Source Location
packages/playwright-core/src/server/webkit/wkProvisionalPage.ts (109 lines)
Class Signature
export class WKProvisionalPage {
readonly _session: WKSession;
readonly initializationPromise: Promise<void>;
constructor(session: WKSession, page: WKPage)
dispose(): void
commit(): void
}
Import
import { WKProvisionalPage } from './server/webkit/wkProvisionalPage';
I/O Contract
Inputs
session: WKSession-- the provisional session in the new processpage: WKPage-- the parent WKPage managing the navigation
Outputs
- Forwards network and page events to the WKPage with overridden frame IDs
- Manages session initialization and cleanup on commit or disposal
Related Pages
- Microsoft_Playwright_WkConnection -- WebKit session management
- Microsoft_Playwright_WkInterceptableRequest -- Request handling during provisional navigation