Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 8a263e30ddaddc768bbe708ffe6f4ed7363518c7
      
https://github.com/WebKit/WebKit/commit/8a263e30ddaddc768bbe708ffe6f4ed7363518c7
  Author: Brian Weinstein <[email protected]>
  Date:   2026-08-13 (Thu, 13 Aug 2026)

  Changed paths:
    M 
Source/WebKit/UIProcess/Extensions/Cocoa/API/WebExtensionContextAPIOffscreenCocoa.mm
    M Source/WebKit/WebProcess/Extensions/API/WebExtensionAPINamespace.cpp
    M 
Source/WebKit/WebProcess/Extensions/Interfaces/WebExtensionAPINamespace.idl
    M Source/WebKit/WebProcess/Extensions/WebExtensionContextProxy.cpp
    M Source/WebKit/WebProcess/Extensions/WebExtensionContextProxy.h
    M Source/WebKit/WebProcess/Extensions/WebExtensionContextProxy.messages.in
    M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/WKWebExtensionAPIOffscreen.mm

  Log Message:
  -----------
  Only give the offscreen web view access to the browser.runtime API
https://bugs.webkit.org/show_bug.cgi?id=321615
rdar://184269255

Reviewed by Kiara Rose.

To do this, we needed to make the existing non-dynamic APIs in the top level 
web extension namespace
dynamic, and always mark them as allowed in the non-offscreen page case.

This PR also tells the Web Process which page is the offscreen page, which we 
will need to implement
runtime.getContexts (https://bugs.webkit.org/show_bug.cgi?id=294456).

Test: Tools/TestWebKitAPI/Tests/WebKit/WKWebView/WKWebExtensionAPIOffscreen.mm

* 
Source/WebKit/UIProcess/Extensions/Cocoa/API/WebExtensionContextAPIOffscreenCocoa.mm:
(WebKit::WebExtensionContext::offscreenCreateDocument): Tell the web process 
about the offscreen page identifier.
* Source/WebKit/WebProcess/Extensions/API/WebExtensionAPINamespace.cpp:
(WebKit::WebExtensionAPINamespace::isPropertyAllowed): Move up the logic to 
grant the test API if we are in testing mode,
only grant runtime for offscreen pages, and make sure everything else is always 
granted.
* Source/WebKit/WebProcess/Extensions/Interfaces/WebExtensionAPINamespace.idl:
* Source/WebKit/WebProcess/Extensions/WebExtensionContextProxy.cpp:
(WebKit::WebExtensionContextProxy::setOffscreenPage):
(WebKit::WebExtensionContextProxy::isOffscreenPage const):
(WebKit::WebExtensionContextProxy::setOffscreenPageIdentifier):
* Source/WebKit/WebProcess/Extensions/WebExtensionContextProxy.h:
* Source/WebKit/WebProcess/Extensions/WebExtensionContextProxy.messages.in:
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/WKWebExtensionAPIOffscreen.mm:
(TestWebKitAPI::TEST_F(WKWebExtensionAPIOffscreen, 
OffscreenDocumentAPIAvailability)): Check the availability for all APIs
in the background page, and just runtime in the offscreen page.

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



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

Reply via email to