Bug 204775 - Web Inspector: provide a way to log messages from the network process
Summary: Web Inspector: provide a way to log messages from the network process
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: Devin Rousso
URL:
Keywords: InRadar
Depends on:
Blocks: 209763
  Show dependency treegraph
 
Reported: 2019-12-02 18:06 PST by Devin Rousso
Modified: 2020-03-31 08:23 PDT (History)
17 users (show)

See Also:


Attachments
Patch (76.50 KB, patch)
2019-12-02 18:47 PST, Devin Rousso
no flags Details | Formatted Diff | Diff
Patch (80.49 KB, patch)
2020-03-28 10:55 PDT, Devin Rousso
no flags Details | Formatted Diff | Diff
Patch (81.12 KB, patch)
2020-03-28 15:51 PDT, Devin Rousso
no flags Details | Formatted Diff | Diff
Patch (81.37 KB, patch)
2020-03-30 12:37 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 2019-12-02 18:06:40 PST
This could be used for ITP and AdClickAttribution debugging to start, rather than requiring the developer use Console.app and filter for specific channel names.
Comment 1 Devin Rousso 2019-12-02 18:47:59 PST
Created attachment 384676 [details]
Patch
Comment 2 EWS Watchlist 2019-12-02 18:48:39 PST
This patch modifies the inspector protocol generator. Please ensure that you have rebaselined any generator test results (i.e., by running `Tools/Scripts/run-inspector-generator-tests --reset-results`)

This patch modifies the inspector protocol. Please ensure that any frontend changes appropriately use feature checks for new protocol features.
Comment 3 Devin Rousso 2019-12-10 11:12:48 PST
Comment on attachment 384676 [details]
Patch

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

> Source/WebInspectorUI/ChangeLog:3
> +        Web Inspector: provide a way to log messages from the network process

We should also add items to the device settings menu for ITP and Ad Click Attribution debug logging so that they can be controlled when remotely inspecting.

> Source/WebKit/WebProcess/Network/NetworkProcessConnection.cpp:274
> +        frame->addConsoleMessage(source, level, message);

We should consider only sending a message to already open inspectors, so that messages aren't shown if an inspector is attached to a tab way later since messages are cached.
Comment 4 BJ Burg 2019-12-10 11:21:22 PST
Comment on attachment 384676 [details]
Patch

r=me. Per our discussion, the approach looks good, but need to fix tests that are failing EWS.
Comment 5 BJ Burg 2020-01-06 12:20:57 PST
Please rebase so we can land it.
Comment 6 Devin Rousso 2020-03-28 10:55:41 PDT
Created attachment 394829 [details]
Patch
Comment 7 Devin Rousso 2020-03-28 15:51:21 PDT
Created attachment 394845 [details]
Patch
Comment 8 Alex Christensen 2020-03-28 19:59:30 PDT
Comment on attachment 394845 [details]
Patch

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

> Source/WebKit/NetworkProcess/NetworkProcess.cpp:2668
> +void NetworkProcess::broadcastConsoleMessage(JSC::MessageSource source, JSC::MessageLevel level, const String& message)

This looks good, but you should consider adding a SessionID as a parameter and only broadcasting to web processes with the same session id.  Otherwise you'll be sending private browsing logs to regular browsing pages and vice versa.
Comment 9 Devin Rousso 2020-03-30 10:59:57 PDT
Comment on attachment 394845 [details]
Patch

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

>> Source/WebKit/NetworkProcess/NetworkProcess.cpp:2668
>> +void NetworkProcess::broadcastConsoleMessage(JSC::MessageSource source, JSC::MessageLevel level, const String& message)
> 
> This looks good, but you should consider adding a SessionID as a parameter and only broadcasting to web processes with the same session id.  Otherwise you'll be sending private browsing logs to regular browsing pages and vice versa.

Good point!  Thanks for taking a look :)
Comment 10 Devin Rousso 2020-03-30 12:37:23 PDT
Created attachment 394948 [details]
Patch
Comment 11 EWS 2020-03-30 15:01:54 PDT
Committed r259236: <https://trac.webkit.org/changeset/259236>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 394948 [details].
Comment 12 Radar WebKit Bug Importer 2020-03-30 15:02:14 PDT
<rdar://problem/61075075>