Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: f01b6d195b0b57832b2b6e915d88e55df7d3c5d4
https://github.com/WebKit/WebKit/commit/f01b6d195b0b57832b2b6e915d88e55df7d3c5d4
Author: Razvan Caliman <[email protected]>
Date: 2026-02-24 (Tue, 24 Feb 2026)
Changed paths:
M Source/WebInspectorUI/UserInterface/Base/Setting.js
M Source/WebInspectorUI/UserInterface/Views/ResourceClusterContentView.js
Log Message:
-----------
Web Inspector: Network: Request / Response menu ignores user’s previous
setting
https://bugs.webkit.org/show_bug.cgi?id=308310
rdar://108231795
Reviewed by BJ Burg.
The existing logic in `WI.ResourceClusterContentView` to reuse the last chosen
content view for a resource has a timing issue. If it's a custom request
content view,
those views are created asynchronously after getting the resource content and
determining
if they're applicable. By this time, the default content view, Request, is used
as a
fallback on the first call to
`WI.ResourceClusterContentView.prototype._showContentViewForIdentifier()`.
Any last known saved preference per-resource is overwritten with the fallback.
This is fixed by first waiting for the custom content views to load.
However, users have requested remembering content view preferences per resource
type
instead of per single resource. This patch introduces a persistent mapping by
MIME type
to the last used content view type identifer to restore a user's prefered
content view.
* Source/WebInspectorUI/UserInterface/Base/Setting.js:
* Source/WebInspectorUI/UserInterface/Views/ResourceClusterContentView.js:
(WI.ResourceClusterContentView.prototype.attached):
(WI.ResourceClusterContentView.prototype.restoreFromCookie):
(WI.ResourceClusterContentView.prototype.showRequest):
(WI.ResourceClusterContentView.prototype.showResponse):
(WI.ResourceClusterContentView.prototype._showContentViewForIdentifier):
(WI.ResourceClusterContentView.prototype._pathComponentSelected):
(WI.ResourceClusterContentView.prototype._resourceLoadingDidFinish):
(WI.ResourceClusterContentView.prototype._getMIMETypeForPreferences):
(WI.ResourceClusterContentView.prototype._getPreferredContentViewIdentifier):
(WI.ResourceClusterContentView.prototype._setPreferredContentViewIdentifier):
(WI.ResourceClusterContentView.prototype._tryEnableCustomResponseContentViews):
(WI.ResourceClusterContentView):
Canonical link: https://commits.webkit.org/308142@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications