Bug 224082 - Web Inspector: add setting to allow inspecting Web Inspector
Summary: Web Inspector: add setting to allow inspecting Web Inspector
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: BJ Burg
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-04-01 15:38 PDT by BJ Burg
Modified: 2021-04-14 17:18 PDT (History)
7 users (show)

See Also:


Attachments
Patch v1.0 (13.74 KB, patch)
2021-04-01 16:00 PDT, BJ Burg
no flags Details | Formatted Diff | Diff
Patch v1.1 (11.46 KB, patch)
2021-04-13 20:46 PDT, BJ Burg
hi: review+
bburg: commit-queue+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description BJ Burg 2021-04-01 15:38:17 PDT
This broke in Catalina releases due to changes in Safari's storage model. Let's put it in the settings UI in case it's needed.

We could additionally restrict this to STP, but what's the point?
Comment 1 BJ Burg 2021-04-01 15:38:54 PDT
<rdar://75695002>
Comment 2 BJ Burg 2021-04-01 16:00:08 PDT
Created attachment 424957 [details]
Patch v1.0
Comment 3 Devin Rousso 2021-04-12 16:40:44 PDT
Comment on attachment 424957 [details]
Patch v1.0

View in context: https://bugs.webkit.org/attachment.cgi?id=424957&action=review

> Source/WebCore/en.lproj/Localizable.strings:152
> +/* Message for geolocation prompt */
> +"Allow â%@â to use your current location?" = "Allow â%@â to use your current location?";

While I do appreciate this, is it strictly speaking necessary in this patch?  Could you just do an unreviewed cleanup fix followup instead?

> Source/WebCore/inspector/InspectorFrontendHost.cpp:583
> +    return m_frontendPage ? m_frontendPage->settings().developerExtrasEnabled() : false;

```
    return m_frontendPage && m_frontendPage->settings().developerExtrasEnabled();
```

> Source/WebCore/inspector/InspectorFrontendHost.idl:96
> +    boolean allowsInspectingInspector();
> +    undefined setAllowsInspectingInspector(boolean allow);

Why not just have `attribute boolean allowsInspectingInspector`?

Also, is it ever actually read anywhere in the frontend?

> Source/WebInspectorUI/UserInterface/Base/Main.js:166
> +//    InspectorFrontendHost.setAllowsInspectingInspector(WI.settings.experimentalAllowInspectingInspector.value);

oops

> Source/WebInspectorUI/UserInterface/Base/Setting.js:232
> +    experimentalAllowInspectingInspector: new WI.Setting("experimental-allow-inspecting-inspector", false),

Is it really necessary to have a `WI.ExperimentalSetting` for this when `DeveloperExtrasEnabled` is already a setting saved on disk?

> Source/WebInspectorUI/UserInterface/Views/SettingsTabContentView.js:411
> +        let diagnosticsGroup = experimentalSettingsView.addGroup(WI.UIString("Diagnostics:", "Diagnostics: @ Experimental Settings", "Category label for experimental settings related to Web Inspector diagnostics."), WI.settings.experimentalCollapseBlackboxedCallFrames, WI.UIString("Collapse blackboxed call frames", "Collapse blackboxed call frames @ Experimental Settings", "Setting to collapse blackboxed call frames in the debugger."));

Why is `WI.settings.experimentalCollapseBlackboxedCallFrames` related to this?  Or was this a copypasta mistake?  :P
Comment 4 Patrick Angle 2021-04-12 16:42:17 PDT
Comment on attachment 424957 [details]
Patch v1.0

View in context: https://bugs.webkit.org/attachment.cgi?id=424957&action=review

> Source/WebCore/ChangeLog:12
> +        * en.lproj/Localizable.strings:

Should probably add a comment here that this is a drive-by change and not related to this patch. I was confused how location permission was related  to Inspector^2 at first.

> Source/WebInspectorUI/UserInterface/Base/Main.js:166
> +//    InspectorFrontendHost.setAllowsInspectingInspector(WI.settings.experimentalAllowInspectingInspector.value);

Oops?

> Source/WebInspectorUI/UserInterface/Views/SettingsTabContentView.js:412
> +        diagnosticsGroup.addSetting(WI.settings.experimentalAllowInspectingInspector, WI.UIString("Allow Inspecting Web Inspector", "Label for setting that allows the user to inspect the Web Inspector user interface."));

I think the use of the two-argument version of this has fallen out of favor (bug 215400) and that we prefer to explicitly provide a key each string.
Comment 5 BJ Burg 2021-04-13 15:34:14 PDT
Comment on attachment 424957 [details]
Patch v1.0

View in context: https://bugs.webkit.org/attachment.cgi?id=424957&action=review

Apologies for the sloppiness in this patch. New one coming up.

>> Source/WebCore/ChangeLog:12
>> +        * en.lproj/Localizable.strings:
> 
> Should probably add a comment here that this is a drive-by change and not related to this patch. I was confused how location permission was related  to Inspector^2 at first.

This was included by accident, I ran the localized strings extractor over the whole codebase apparently.

>> Source/WebInspectorUI/UserInterface/Base/Setting.js:232
>> +    experimentalAllowInspectingInspector: new WI.Setting("experimental-allow-inspecting-inspector", false),
> 
> Is it really necessary to have a `WI.ExperimentalSetting` for this when `DeveloperExtrasEnabled` is already a setting saved on disk?

DeveloperExtrasEnabled can't be set for containerized apps, and having it set the global domain does not necessarily mean WebCore will be able to read it.
Comment 6 BJ Burg 2021-04-13 20:46:01 PDT
Created attachment 425945 [details]
Patch v1.1
Comment 7 Devin Rousso 2021-04-14 13:11:17 PDT
Comment on attachment 425945 [details]
Patch v1.1

r=me
Comment 8 EWS 2021-04-14 16:25:53 PDT
commit-queue failed to commit attachment 425945 [details] to WebKit repository. To retry, please set cq+ flag again.
Comment 9 BJ Burg 2021-04-14 17:18:42 PDT
Committed r275982 (236534@main): <https://commits.webkit.org/236534@main>