Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Microsoft Playwright WkProvisionalPage

From Leeroopedia
Revision as of 11:38, 16 February 2026 by Admin (talk | contribs) (Auto-imported from implementations/Microsoft_Playwright_WkProvisionalPage.md)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Template:Implementation Page

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 WKPage handlers
  • 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 process
  • page: 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

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment