Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: acdd0f6e892421f7b09d5bb088e3c753bc1f1f42
https://github.com/WebKit/WebKit/commit/acdd0f6e892421f7b09d5bb088e3c753bc1f1f42
Author: Qianlang Chen <[email protected]>
Date: 2026-09-23 (Wed, 23 Sep 2026)
Changed paths:
A
LayoutTests/http/tests/site-isolation/inspector/page/network-manager-aggregated-resource-tree-attach-after-load-expected.txt
A
LayoutTests/http/tests/site-isolation/inspector/page/network-manager-aggregated-resource-tree-attach-after-load.html
M Source/WebInspectorUI/UserInterface/Controllers/NetworkManager.js
M Source/WebInspectorUI/UserInterface/Models/Frame.js
M Source/WebInspectorUI/UserInterface/Models/Resource.js
M Source/WebInspectorUI/UserInterface/Views/NetworkTableContentView.js
Log Message:
-----------
[Site Isolation] Web Inspector: Cross-origin resources don't show up in
Network unless the page is reloaded with inspector open
https://bugs.webkit.org/show_bug.cgi?id=322556
rdar://185847508
Reviewed by BJ Burg.
Opening the inspector on an already-loaded page shows nothing in the
Network tab for a cross-origin iframe except one placeholder row named
after its origin. Reloading with the inspector open shows everything.
The per-page target's Page.getResourceTree can't describe a RemoteFrame
beyond its security origin, and nothing replays loads that finished
before the frontend attached. ProxyingPageAgent already assembles an
aggregated cross-process tree on the UIProcess for exactly this purpose
(NetworkManager.initializeTarget's comment already said as much);
nothing called it. This fetches it once the first Frame target appears,
since that is what signals the proxying agents are live, and folds the
result into the frame model.
The merge is a separate entry point rather than a second call into
_processMainFrameResourceTreePayload, which rebuilds the frame and
request maps from scratch and would discard anything live events have
already recorded. The merge instead only fills in what the model is
missing -- frames it has never seen, and resources whose URL a frame
doesn't already have -- so it is safe to run at any time, more than
once, and interleaved with live events.
A placeholder main resource is corrected in place rather than replaced
and announced as a navigation, since it is the same load:
Frame.initialize() would tear down subresources, child frames and
execution contexts as if this were a real navigation, but under Site
Isolation those are reported by the frame target and will not be
reported again without an actual navigation. A frame is corrected only
when the snapshot's loaderId is known to match the load already on the
frame, or the frame has none yet -- live events are always at least as
current as the snapshot.
The order of the two replies is not guaranteed by the protocol: the
aggregated fetch is even issued later than the page target's own
getResourceTree, once the first Frame target appears, but in practice
it usually still arrives first. A reply that arrives before the page
target's own bootstrap finishes is remembered and re-requested once
the model is rebuilt, rather than merged into a model that is about to
be discarded.
Test:
http/tests/site-isolation/inspector/page/network-manager-aggregated-resource-tree-attach-after-load.html
*
LayoutTests/http/tests/site-isolation/inspector/page/network-manager-aggregated-resource-tree-attach-after-load-expected.txt:
Added.
*
LayoutTests/http/tests/site-isolation/inspector/page/network-manager-aggregated-resource-tree-attach-after-load.html:
Added.
* Source/WebInspectorUI/UserInterface/Controllers/NetworkManager.js:
(WI.NetworkManager.prototype.initializeTarget):
(WI.NetworkManager.prototype._addNewResourceToFrameOrTarget):
(WI.NetworkManager.prototype._processMainFrameResourceTreePayload):
(WI.NetworkManager.prototype._requestAggregatedResourceTree):
(WI.NetworkManager.prototype._mergeAggregatedResourceTreePayload):
(WI.NetworkManager.prototype._mergeAggregatedFrameTreePayload):
(WI.NetworkManager.prototype._shouldUpdatePlaceholderMainResource):
(WI.NetworkManager.prototype._canUpdateMainResourceFromPayload):
* Source/WebInspectorUI/UserInterface/Models/Frame.js:
(WI.Frame.prototype.updatePlaceholderMainResource):
(WI.Frame.prototype.updateInitialPlaceholderMainResource):
* Source/WebInspectorUI/UserInterface/Models/Resource.js:
(WI.Resource.prototype.updatePlaceholderURL):
(WI.Resource.prototype.get mimeTypeComponents):
(WI.Resource.prototype.updateInitialPlaceholderURL):
(WI.Resource.prototype.updateForResponse):
* Source/WebInspectorUI/UserInterface/Views/NetworkTableContentView.js:
(WI.NetworkTableContentView):
(WI.NetworkTableContentView.prototype.closed):
(WI.NetworkTableContentView.prototype._handleResourceURLDidChange):
Canonical link: https://commits.webkit.org/321712@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications