You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
// `preferences` is a referenced object. Changing its contents and simply setting it as a new value won't qualify as value change so it won't be persisted.
0 commit comments