Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 1663a8831d14cd4ef327591402996ff061d3c91c
      
https://github.com/WebKit/WebKit/commit/1663a8831d14cd4ef327591402996ff061d3c91c
  Author: Anuj Panta <[email protected]>
  Date:   2026-07-21 (Tue, 21 Jul 2026)

  Changed paths:
    A 
LayoutTests/http/tests/site-isolation/inspector/page/resource-content-cross-origin-iframe-expected.txt
    A 
LayoutTests/http/tests/site-isolation/inspector/page/resource-content-cross-origin-iframe.html
    A 
LayoutTests/http/tests/site-isolation/inspector/page/resources/resource-content-subframe-style.css
    A 
LayoutTests/http/tests/site-isolation/inspector/page/resources/resource-content-subframe.html
    M Source/JavaScriptCore/inspector/protocol/Page.json
    M Source/WebCore/inspector/InspectorIdentifierRegistry.h
    M Source/WebCore/inspector/agents/InspectorPageAgent.cpp
    M Source/WebCore/inspector/agents/InspectorPageAgent.h
    M Source/WebInspectorUI/UserInterface/Controllers/NetworkManager.js
    M Source/WebInspectorUI/UserInterface/Models/Resource.js
    M Source/WebKit/UIProcess/Inspector/Agents/ProxyingPageAgent.cpp
    M Source/WebKit/UIProcess/Inspector/Agents/ProxyingPageAgent.h
    M Source/WebKit/WebProcess/Inspector/WebInspectorBackend.cpp
    M Source/WebKit/WebProcess/Inspector/WebInspectorBackend.h
    M Source/WebKit/WebProcess/Inspector/WebInspectorBackend.messages.in

  Log Message:
  -----------
  Web Inspector: [SI] implement Page.getResourceContent under Site Isolation
https://bugs.webkit.org/show_bug.cgi?id=319605
rdar://182434202

Reviewed by Qianlang Chen.

Page.getResourceContent was a stub under Site Isolation, breaking the
Resources tab fallback content path for cross-origin frames (their document
and cached subresources live in another WebContent process). Implement it by
fetching the bytes from the frame's hosting process over IPC.

- Page.json: flip getResourceContent to async (a cross-process reply needs a
callback); convert the in-process InspectorPageAgent to the callback form.
- New GetFrameResourceContent IPC + WebInspectorBackend handler: serve the
committed main document (exact url match) else a cached subresource by url --
the same two-step lookup as ResourceUtilities::resourceContent, composed from
exported primitives (resourceContent itself isn't WEBCORE_EXPORT).
- ProxyingPageAgent::getResourceContent: parse the process-qualified frameId,
route to the hosting process, fail cleanly on every error path.
- parseProtocolFrameId: validate raw values before constructing identifiers so
a malformed frameId is a parse failure, not a UIProcess crash.
- Resource.js: route the getResourceContent fallback through WI.backendTarget
under Site Isolation (the in-process page target can't reach a remote frame);
unchanged without Site Isolation.
- Add a Site Isolation layout test (child document, subresource, main-frame
document, invalid frameId, missing resource).

Test: 
http/tests/site-isolation/inspector/page/resource-content-cross-origin-iframe.html

* 
LayoutTests/http/tests/site-isolation/inspector/page/resource-content-cross-origin-iframe-expected.txt:
 Added.
* 
LayoutTests/http/tests/site-isolation/inspector/page/resource-content-cross-origin-iframe.html:
 Added.
* 
LayoutTests/http/tests/site-isolation/inspector/page/resources/resource-content-subframe-style.css:
 Added.
(body):
* 
LayoutTests/http/tests/site-isolation/inspector/page/resources/resource-content-subframe.html:
 Added.
* Source/JavaScriptCore/inspector/protocol/Page.json:
* Source/WebCore/inspector/InspectorIdentifierRegistry.h:
(Inspector::IdentifierRegistry::parseProtocolFrameId):
* Source/WebCore/inspector/agents/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::getResourceContent):
* Source/WebCore/inspector/agents/InspectorPageAgent.h:
* Source/WebInspectorUI/UserInterface/Controllers/NetworkManager.js:
(WI.NetworkManager.prototype.initializeTarget):
(WI.NetworkManager.prototype.get enabledPageForSiteIsolation):
* Source/WebInspectorUI/UserInterface/Models/Resource.js:
(WI.Resource.prototype.requestContentFromBackend):
* Source/WebKit/UIProcess/Inspector/Agents/ProxyingPageAgent.cpp:
(Inspector::ProxyingPageAgent::getResourceContent):
* Source/WebKit/UIProcess/Inspector/Agents/ProxyingPageAgent.h:
* Source/WebKit/WebProcess/Inspector/WebInspectorBackend.cpp:
(WebKit::WebInspectorBackend::getFrameResourceContent):
* Source/WebKit/WebProcess/Inspector/WebInspectorBackend.h:
* Source/WebKit/WebProcess/Inspector/WebInspectorBackend.messages.in:

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



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

Reply via email to