Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 6dd9ed3d3ea1fd36f678f2652c05097f61b0caa7
      
https://github.com/WebKit/WebKit/commit/6dd9ed3d3ea1fd36f678f2652c05097f61b0caa7
  Author: BJ Burg <[email protected]>
  Date:   2026-08-12 (Wed, 12 Aug 2026)

  Changed paths:
    M Source/WebKit/UIProcess/API/Cocoa/_WKAutomationSession.mm
    M Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp
    M Source/WebKit/UIProcess/Automation/WebAutomationSession.h
    M Source/WebKit/UIProcess/WebProcessPool.cpp

  Log Message:
  -----------
  [Web Automation] Apply the session's Site Isolation preference to vended 
automation pages
https://bugs.webkit.org/show_bug.cgi?id=296394
rdar://178913733

Reviewed by Qianlang Chen and Sihui Liu.

An automation session created with siteIsolationEnabled had no way to carry that
preference onto the pages it vends: the flag lived on the
_WKAutomationSessionConfiguration but was never applied to a new browsing 
context's
WebPreferences, so Site Isolation never engaged for automation-driven pages.

Stamp the configuration's siteIsolationEnabled onto WebAutomationSession at
session-creation time, then in createBrowsingContext() inject it into the vended
page's WebPreferences before process assignment. Only the vended automation 
page is affected;
sibling pool pages keep their own preferences.

Update `WebProcessPool` to override keeping frames in the same process when 
site isolation is enabled.
That behavior was introduced in https://commits.webkit.org/201369@main as a 
guard against PSON (process swap on nagivation)
to force keeping automation sessions working the same process.

Automation was built on a single-process-per-page assumption that predates both 
PSON and site isolation.
`WebAutomationSession` (UI process) drives one `WebAutomationSessionProxy` per 
`WebProcess`,
and it caches state that only means anything inside a specific WebProcess:
- injected JS atoms,
- element/node handles
- the current frame handle.

* Source/WebKit/UIProcess/API/Cocoa/_WKAutomationSession.mm:
(-[_WKAutomationSession initWithConfiguration:]):
* Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::WebAutomationSession):
(WebKit::WebAutomationSession::createBrowsingContext):
* Source/WebKit/UIProcess/Automation/WebAutomationSession.h:
* Source/WebKit/UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::processForNavigationInternal):

Canonical link: https://commits.webkit.org/319024@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to