Closed Bug 1764348 Opened 2 years ago Closed 2 years ago

Enable users control network monitoring in the browser/browsertoolbox console and netmonitor

Categories

(DevTools :: Framework, enhancement)

enhancement
Not set
normal

Tracking

(firefox103 fixed)

RESOLVED FIXED
103 Branch
Tracking Status
firefox103 --- fixed

People

(Reporter: Honza, Assigned: bomsy)

References

(Blocks 1 open bug)

Details

Attachments

(3 files, 1 obsolete file)

In order to improve performance of the Browser Toolbox (including start up time) the Network panel should be disabled by default.

There are some UI/UX considerations:

  • We can reuse pause button in the panel or hide the panel entirely using settings
  • Switching Console filters XHR/Requests off, doesn’t pause the panel
  • Console has XHR/Requests off by default already
  • We want to have no listener registered and collect no data if the panel is disabled
  • There might be a BT specific UI (e.g. message)

Also, the Browser Console panel should work well along side with:

  • Disabled Network panel
  • Showing HTTP requests when they come from chrome scope
  • Options XHR and Requests
  • Content filtering

Honza

Type: defect → enhancement
Assignee: nobody → hmanilla
Status: NEW → ASSIGNED
Attachment #9274660 - Attachment description: Bug 1764348 - WIP Stop listening for network requests until net/netxhr filter is turned on → Bug 1764348 - Enable browser console / browser toolbox console users turn on network monitoring manually r=nchevobbe
Pushed by hmanilla@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/712947c3a514
Cleanup hidePersistLogsCheckbox and hideShowContentMessagesCheckbox property r=nchevobbe
https://hg.mozilla.org/integration/autoland/rev/47658c248d9e
Enable browser console / browser toolbox console users turn on network monitoring manually r=nchevobbe
https://hg.mozilla.org/integration/autoland/rev/0ee89f81d7da
Pause / Resume should toggle listening to network resources r=ochameau
Regressions: 1772359
Regressions: 1772363
Regressions: 1772374

Backed out for causing multiple dt failures. Please also check the regressed bugs from this.

Push with failures

Failure log

Backout link

[task 2022-06-02T19:46:28.311Z] 19:46:28     INFO - TEST-PASS | devtools/client/webconsole/test/browser/browser_console_enable_network_monitoring.js | setting is enabled - 
[task 2022-06-02T19:46:28.312Z] 19:46:28     INFO - Matched a message with text: "test-image.png?id=4", all messages received.
[task 2022-06-02T19:46:28.312Z] 19:46:28     INFO - Clear and close the Browser Console
[task 2022-06-02T19:46:28.312Z] 19:46:28     INFO - Clear the browser console output
[task 2022-06-02T19:46:28.312Z] 19:46:28     INFO - Browser console cleared
[task 2022-06-02T19:46:28.313Z] 19:46:28     INFO - Wait for all Browser Console targets to be attached
[task 2022-06-02T19:46:28.313Z] 19:46:28     INFO - Waiting 1 seconds.
[task 2022-06-02T19:46:28.313Z] 19:46:28     INFO - Close the Browser Console
[task 2022-06-02T19:46:28.313Z] 19:46:28     INFO - Browser Console closed
[task 2022-06-02T19:46:28.314Z] 19:46:28     INFO - Leaving test bound testEnableNetworkMonitoringInBrowserConsole
[task 2022-06-02T19:46:28.314Z] 19:46:28     INFO - Entering test bound testEnableNetworkMonitoringInWebConsole
[task 2022-06-02T19:46:28.314Z] 19:46:28     INFO - Adding a new tab with URL: data:text/html,<!DOCTYPE html><script>foo;</script>
[task 2022-06-02T19:46:28.314Z] 19:46:28     INFO - Console message: [JavaScript Error: "NotFoundError: No such JSWindowActor 'DevToolsFrame'"]
[task 2022-06-02T19:46:28.315Z] 19:46:28     INFO - Console message: [JavaScript Error: "NotFoundError: No such JSWindowActor 'DevToolsFrame'"]
[task 2022-06-02T19:46:28.315Z] 19:46:28     INFO - Console message: [JavaScript Error: "NotFoundError: No such JSWindowActor 'DevToolsFrame'"]
[task 2022-06-02T19:46:28.315Z] 19:46:28     INFO - Console message: [JavaScript Error: "NotFoundError: No such JSWindowActor 'DevToolsFrame'"]
[task 2022-06-02T19:46:28.316Z] 19:46:28     INFO - Console message: [JavaScript Error: "NotFoundError: No such JSWindowActor 'DevToolsFrame'"]
[task 2022-06-02T19:46:28.316Z] 19:46:28     INFO - Console message: [JavaScript Error: "NotFoundError: No such JSWindowActor 'DevToolsFrame'"]
[task 2022-06-02T19:46:28.317Z] 19:46:28     INFO - Console message: [JavaScript Error: "ReferenceError: foo is not defined" {file: "data:text/html,<!DOCTYPE html><script>foo;</script>" line: 1}]
[task 2022-06-02T19:46:28.317Z] 19:46:28     INFO - @data:text/html,<!DOCTYPE html><script>foo;</script>:1:1
[task 2022-06-02T19:46:28.317Z] 19:46:28     INFO - 
[task 2022-06-02T19:46:28.317Z] 19:46:28     INFO - Tab added and finished loading
[task 2022-06-02T19:46:28.317Z] 19:46:28     INFO - Opening the toolbox
[task 2022-06-02T19:46:28.318Z] 19:46:28     INFO - Console message: [JavaScript Error: "Content Security Policy: The page’s settings blocked the loading of a resource at inline (“default-src”)." {file: "chrome" line: 511}]
[task 2022-06-02T19:46:28.318Z] 19:46:28     INFO - Console message: [JavaScript Error: "Content Security Policy: The page’s settings blocked the loading of a resource at inline (“default-src”)." {file: "chrome" line: 511}]
[task 2022-06-02T19:46:28.318Z] 19:46:28     INFO - Console message: [JavaScript Error: "Content Security Policy: The page’s settings blocked the loading of a resource at inline (“default-src”)." {file: "chrome" line: 62}]
[task 2022-06-02T19:46:28.319Z] 19:46:28     INFO - Console message: [JavaScript Error: "Content Security Policy: The page’s settings blocked the loading of a resource at inline (“default-src”)." {file: "chrome" line: 511}]
[task 2022-06-02T19:46:28.319Z] 19:46:28     INFO - Console message: [JavaScript Error: "Content Security Policy: The page’s settings blocked the loading of a resource at inline (“default-src”)." {file: "chrome" line: 511}]
[task 2022-06-02T19:46:28.319Z] 19:46:28     INFO - Console message: [JavaScript Error: "Content Security Policy: The page’s settings blocked the loading of a resource at inline (“default-src”)." {file: "chrome" line: 62}]
[task 2022-06-02T19:46:28.320Z] 19:46:28     INFO - Buffered messages logged at 19:46:28
[task 2022-06-02T19:46:28.320Z] 19:46:28     INFO - Toolbox opened and focused
[task 2022-06-02T19:46:28.320Z] 19:46:28     INFO - TEST-PASS | devtools/client/webconsole/test/browser/browser_console_enable_network_monitoring.js | The 'Enable Network Monitoring' setting item should not be avaliable in the webconsole - 
[task 2022-06-02T19:46:28.321Z] 19:46:28     INFO - Leaving test bound testEnableNetworkMonitoringInWebConsole
[task 2022-06-02T19:46:28.321Z] 19:46:28     INFO - Removing tab.
[task 2022-06-02T19:46:28.321Z] 19:46:28     INFO - Waiting for event: 'TabClose' on [object XULElement].
[task 2022-06-02T19:46:28.322Z] 19:46:28     INFO - Got event: 'TabClose' on [object XULElement].
[task 2022-06-02T19:46:28.322Z] 19:46:28     INFO - Tab removed and finished closing
[task 2022-06-02T19:46:28.322Z] 19:46:28     INFO - Console message: [JavaScript Error: "NotFoundError: No such JSWindowActor 'DevToolsFrame'"]
[task 2022-06-02T19:46:28.323Z] 19:46:28     INFO - TEST-PASS | devtools/client/webconsole/test/browser/browser_console_enable_network_monitoring.js | The main process DevToolsServer has no pending connection when the test ends - 
[task 2022-06-02T19:46:28.323Z] 19:46:28     INFO - Buffered messages finished
[task 2022-06-02T19:46:28.324Z] 19:46:28     INFO - TEST-UNEXPECTED-FAIL | devtools/client/webconsole/test/browser/browser_console_enable_network_monitoring.js | This test exceeded the timeout threshold. It should be rewritten or split up. If that's not possible, use requestLongerTimeout(N), but only as a last resort. - 
[task 2022-06-02T19:46:28.324Z] 19:46:28     INFO - GECKO(2285) | MEMORY STAT | vsize 16353MB | residentFast 515MB | heapAllocated 156MB
[task 2022-06-02T19:46:28.325Z] 19:46:28     INFO - TEST-OK | devtools/client/webconsole/test/browser/browser_console_enable_network_monitoring.js | took 62263ms
[task 2022-06-02T19:46:28.325Z] 19:46:28     INFO - checking window state
[task 2022-06-02T19:46:28.325Z] 19:46:28     INFO - TEST-START | devtools/client/webconsole/test/browser/browser_console_error_source_click.js
Flags: needinfo?(hmanilla)
Pushed by hmanilla@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/bbec7952f80e
Cleanup hidePersistLogsCheckbox and hideShowContentMessagesCheckbox property r=nchevobbe
https://hg.mozilla.org/integration/autoland/rev/5e5d5e5ae556
Enable browser console / browser toolbox console users turn on network monitoring manually r=nchevobbe
Flags: needinfo?(hmanilla)
Keywords: leave-open

With this patch Pause and Resume, now stop and start listening to network requests.

Attachment #9276711 - Attachment is obsolete: true
Pushed by hmanilla@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/e9828113f050
Pause / Resume should toggle listening to network resources r=ochameau
Keywords: leave-open
Regressions: 1773018
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 103 Branch
Regressions: 1685949

Noticed a performance improvement on Browser Console memory tests:

== Change summary for alert #34323 (as of Mon, 06 Jun 2022 20:28:47 GMT) ==

Improvements:

Ratio Test Platform Options Absolute values (old vs new)
14% browser-console:parent-process objects-with-stacks linux1804-64-shippable-qr 25,563.21 -> 22,101.75
14% browser-console:parent-process objects-with-stacks linux1804-64-qr 25,558.54 -> 22,099.50
11% browser-console:parent-process objects-with-no-stacks linux1804-64-shippable-qr 54,369.25 -> 48,168.67
11% browser-console:parent-process objects-with-no-stacks linux1804-64-qr 54,475.75 -> 48,310.25

For up to date results, see: https://treeherder.mozilla.org/perfherder/alerts?id=34323

Summary: Disable Browser Toolbox Network panel by default → Allows users more control over network monitoring in the browser/browsertoolbox console and netmonitor
Summary: Allows users more control over network monitoring in the browser/browsertoolbox console and netmonitor → Enable users control network monitoring in the browser/browsertoolbox console and netmonitor
Blocks: 1778672
Regressions: 1781269
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: