Bug 209763 - Web Inspector: provide a way for inspector to turn on/off ITP debug mode and AdClickAttribution debug mode
Summary: Web Inspector: provide a way for inspector to turn on/off ITP debug mode and ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Local Build
Hardware: All All
: P2 Normal
Assignee: Devin Rousso
URL:
Keywords: InRadar
Depends on: 204775
Blocks:
  Show dependency treegraph
 
Reported: 2020-03-30 13:43 PDT by Devin Rousso
Modified: 2020-05-04 14:28 PDT (History)
13 users (show)

See Also:


Attachments
[Patch] WIP (23.55 KB, patch)
2020-04-10 21:25 PDT, Devin Rousso
hi: commit-queue-
Details | Formatted Diff | Diff
[Patch] WIP (24.27 KB, patch)
2020-04-11 09:52 PDT, Devin Rousso
hi: commit-queue-
Details | Formatted Diff | Diff
Patch (36.22 KB, patch)
2020-04-28 21:05 PDT, Devin Rousso
no flags Details | Formatted Diff | Diff
Patch (39.51 KB, patch)
2020-04-28 23:43 PDT, Devin Rousso
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Devin Rousso 2020-03-30 13:43:04 PDT
Now that we send ITP debug logs and AdClickAttribution debug logs to Web Inspector, we should have a way for Web Inspector to turn those debug modes on/off in addition to (or instead of) the Debug menu toggle.
Comment 1 Devin Rousso 2020-04-10 21:25:47 PDT
Created attachment 396147 [details]
[Patch] WIP

needs tests and ChangeLog entries, but the logic seems to be working and I believe is therefore reviewable :)
Comment 2 EWS Watchlist 2020-04-10 21:26:27 PDT
This patch modifies the inspector protocol. Please ensure that any frontend changes appropriately use feature checks for new protocol features.
Comment 3 Devin Rousso 2020-04-11 09:52:37 PDT
Created attachment 396168 [details]
[Patch] WIP

don't broadcast a console message if the state doesn't change
Comment 4 BJ Burg 2020-04-15 15:44:00 PDT
Comment on attachment 396168 [details]
[Patch] WIP

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

Looks good to me overall. Some things to finish per our discussion:
- Inspector tests for new settings
- Handling multiple inspected pages in NetworkProcess
- Recover from crashed inspected pages that turned on ITP debug mode

> Source/WebCore/inspector/InspectorClient.h:67
> +    enum class Preference {

Can we call these DeveloperPreferences just to not mix them up with Safari preferences or WebCore settings?
Comment 5 Devin Rousso 2020-04-28 21:05:05 PDT
Created attachment 397920 [details]
Patch
Comment 6 Devin Rousso 2020-04-28 23:43:00 PDT
Created attachment 397934 [details]
Patch
Comment 7 John Wilander 2020-04-29 15:03:27 PDT
Does this automatically turn off ITP Debug Mode when the browser is quit/killed?
Comment 8 Devin Rousso 2020-04-29 15:07:19 PDT
(In reply to John Wilander from comment #7)
> Does this automatically turn off ITP Debug Mode when the browser is quit/killed?
It should turn off ITP Debug Mode and Ad Click Attribution Debug Mode when Web Inspector closes.

Also, these paths shouldn't involve anything persistent (e.g. `NSUserDefaults`), so another "yes" as well :)
Comment 9 BJ Burg 2020-05-01 15:55:43 PDT
Comment on attachment 397934 [details]
Patch

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

r=me, please investigate Windows EWS failure:

  UnifiedSource-f74e0903-3.cpp
C:\cygwin\home\buildbot\worker\Windows-EWS\build\Source\WebCore\inspector/agents/InspectorPageAgent.cpp(464,1): error C2051: case expression not constant (compiling source file C:\cygwin\home\buildbot\worker\Windows-EWS\build\WebKitBuild\Release\DerivedSources\WebCore\unified-sources\UnifiedSource-84c9f43f-6.cpp) [C:\cygwin\home\buildbot\worker\Windows-EWS\build\WebKitBuild\Release\Source\WebCore\WebCore.vcxproj]

> Source/WebInspectorUI/ChangeLog:12
> +            Enable: [ ] ITP Debug Mode

If we have documentation for these things, then a link to that documentation from the settings page would be Awesome.

If not, shouldn't we document it?
Comment 10 Devin Rousso 2020-05-01 16:33:33 PDT
Comment on attachment 397934 [details]
Patch

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

(In reply to Brian Burg from comment #9)
> r=me, please investigate Windows EWS failure:
> 
> UnifiedSource-f74e0903-3.cpp
> C:\cygwin\home\buildbot\worker\Windows-EWS\build\Source\WebCore\inspector/agents/InspectorPageAgent.cpp(464,1): error C2051: case expression not constant (compiling source file C:\cygwin\home\buildbot\worker\Windows-EWS\build\WebKitBuild\Release\DerivedSources\WebCore\unified-sources\UnifiedSource-84c9f43f-6.cpp) [C:\cygwin\home\buildbot\worker\Windows-EWS\build\WebKitBuild\Release\Source\WebCore\WebCore.vcxproj]

The windows bot doesn't seem to update/regenerate DerivedSources properly.  This has happened a bunch of times when I've made changes to the protocol.  A clean build has always fixed the issue.

>> Source/WebInspectorUI/ChangeLog:12
>> +            Enable: [ ] ITP Debug Mode
> 
> If we have documentation for these things, then a link to that documentation from the settings page would be Awesome.
> 
> If not, shouldn't we document it?

We have the old blog post for the Device Settings menu <https://webkit.org/changing-page-settings-on-ios-using-web-inspector/>, as well as the section about ITP debug mode <https://webkit.org/intelligent-tracking-prevention-2-3/> and Ad Click Attribution debugging <https://webkit.org/blog/8943/privacy-preserving-ad-click-attribution-for-the-web/>.

Ideally, we'd "combine" those three into a new reference page.  Perhaps I can write one once/before this is in the hands of actual users :)
Comment 11 EWS 2020-05-04 12:51:21 PDT
Committed r261103: <https://trac.webkit.org/changeset/261103>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 397934 [details].
Comment 12 Radar WebKit Bug Importer 2020-05-04 12:52:16 PDT
<rdar://problem/62857406>
Comment 13 Alex Christensen 2020-05-04 14:28:10 PDT
Comment on attachment 397934 [details]
Patch

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

> Source/WebCore/inspector/agents/InspectorPageAgent.cpp:452
> +    case Inspector::Protocol::Page::Setting::AdClickAttributionDebugModeEnabled:

https://build.webkit.org/builders/Apple%20Win%2010%20Release%20%28Build%29/builds/13252/steps/compile-webkit/logs/stdio