RESOLVED FIXED 230923
Web Inspector: add settings option for 'Show Mock Web Extension Tab' in engineering builds
https://bugs.webkit.org/show_bug.cgi?id=230923
Summary Web Inspector: add settings option for 'Show Mock Web Extension Tab' in engin...
Blaze Burg
Reported 2021-09-28 16:32:20 PDT
.
Attachments
Patch v1.0 (7.61 KB, patch)
2021-09-28 16:42 PDT, Blaze Burg
no flags
Patch v1.1 (for landing) (7.59 KB, patch)
2021-09-28 22:41 PDT, Blaze Burg
no flags
Blaze Burg
Comment 1 2021-09-28 16:42:23 PDT
Created attachment 439543 [details] Patch v1.0
Devin Rousso
Comment 2 2021-09-28 16:56:37 PDT
Comment on attachment 439543 [details] Patch v1.0 View in context: https://bugs.webkit.org/attachment.cgi?id=439543&action=review r=me with some fixes > Source/WebInspectorUI/UserInterface/Debug/Bootstrap.js:153 > + let enabled = WI.settings.engineeringShowMockWebExtensionTab.value; > + if (!enabled) { NIT: you don't need to save this to a variable if it's only used once > Source/WebInspectorUI/UserInterface/Debug/Bootstrap.js:155 > + mockWebExtension = null; this doesn't appear to be created anywhere > Source/WebInspectorUI/UserInterface/Debug/Bootstrap.js:161 > + console.error("Problem creating mock web extension: " + error); Do you wanna `WI.reportInternalError` so that the Uncaught Exception Reporter is shown? > Source/WebInspectorUI/UserInterface/Debug/Bootstrap.js:167 > + console.error("Problem creating mock web extension tab: " + result); ditto (:161) > Source/WebInspectorUI/UserInterface/Debug/Bootstrap.js:171 > + WI.settings.engineeringShowMockWebExtensionTab.addEventListener(WI.Setting.Event.Changed, updateMockWebExtensionTab, null); I think the `null` will cause an assertion to fail, as we need to have a `thisObject` in order for `WeakRef` to work properly. You can use `WI.settings.engineeringShowMockWebExtensionTab` as the `thisObject` since it's the first thing checked inside the listener (and it matches other things).
Radar WebKit Bug Importer
Comment 3 2021-09-28 16:58:02 PDT
Blaze Burg
Comment 4 2021-09-28 22:25:57 PDT
Comment on attachment 439543 [details] Patch v1.0 View in context: https://bugs.webkit.org/attachment.cgi?id=439543&action=review >> Source/WebInspectorUI/UserInterface/Debug/Bootstrap.js:155 >> + mockWebExtension = null; > > this doesn't appear to be created anywhere Oops. >> Source/WebInspectorUI/UserInterface/Debug/Bootstrap.js:161 >> + console.error("Problem creating mock web extension: " + error); > > Do you wanna `WI.reportInternalError` so that the Uncaught Exception Reporter is shown? Good idea. >> Source/WebInspectorUI/UserInterface/Debug/Bootstrap.js:171 >> + WI.settings.engineeringShowMockWebExtensionTab.addEventListener(WI.Setting.Event.Changed, updateMockWebExtensionTab, null); > > I think the `null` will cause an assertion to fail, as we need to have a `thisObject` in order for `WeakRef` to work properly. You can use `WI.settings.engineeringShowMockWebExtensionTab` as the `thisObject` since it's the first thing checked inside the listener (and it matches other things). Oh, I totally forgot about that change, but it's coming back to me now. Thanks for explaining.
Blaze Burg
Comment 5 2021-09-28 22:41:17 PDT
Created attachment 439567 [details] Patch v1.1 (for landing)
EWS
Comment 6 2021-09-28 23:32:37 PDT
Committed r283212 (242254@main): <https://commits.webkit.org/242254@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 439567 [details].
Note You need to log in before you can comment on or make changes to this bug.