Closed Bug 1524276 Opened 2 years ago Closed 2 years ago

Group anti-tracking warnings in the console

Categories

(Core :: Privacy: Anti-Tracking, defect, P1)

defect

Tracking

()

VERIFIED FIXED
mozilla67
Tracking Status
firefox68 --- verified

People

(Reporter: ehsan, Assigned: nchevobbe, NeedInfo)

References

(Blocks 1 open bug)

Details

(Whiteboard: [console-grouping])

Attachments

(5 files, 1 obsolete file)

See this page for example: https://atitude32.blogspot.com/. Just visiting the page causes hundreds of "Request to access cookie or storage..." warnings to appear on the console.

Thanks for filing Ehsan.
We do have plans to have similar warning messages grouped (See Bug 1522396).
The work will start in a couple weeks, and I guess I'll start with tracking protection messages :)

Whiteboard: [console-unclutter]
Summary: The anti-tracking web console warnings can be too spammy → Group anti-tracking warnings in the console
Component: Tracking Protection → Privacy: Anti-Tracking
Priority: -- → P2
Product: Firefox → Core
Target Milestone: --- → mozilla67
Whiteboard: [console-unclutter] → [console-grouping]
Assignee: nobody → nchevobbe
Status: NEW → ASSIGNED
Priority: P2 → P1
Blocks: 1534927
Blocks: 1534932

Hello Ehsan, as you can see in the screenshot attached, this patch is almost done :)

I'm not really satisfied with the group label though (Tracking protection message might not be the best for devs).
Would you have a better idea than mine? Thanks!

Flags: needinfo?(ehsan)

This file will be used in the client to group
related messages, so it needs to be in the
shared folder.

This will be used to group similar messages together.
Stubs are updated.

Depends on D23547

This will be used to enable groups of warning messages (Tracking Protection,
CSP, CORS, …).

Depends on D23549

Looks great, thanks Nicolas. This is a copy question, so I'll forward it to Michelle for a final opinion. We call these features Content Blocking in the preferences UI so perhaps we want to call them something similar here too.

Flags: needinfo?(ehsan) → needinfo?(mheubusch)

This component will be used to render warning groups messages.
We also add a inWarningGroup prop to the Message component
so warnings that will be displayed in such warningGroup can
be styled differently (no warning icon, a different color for
the indent).

Depends on D23550

If there's at least 2 tracking protection messages displayed
for a given page navigation, we display a tracking protection
warning group containing the messages, collapsed by default.
This means we need to move or insert those warning messages
at the right position in visibleMessages, either when they're
added, or when we expand a group.
We also need to style those messages inside the group differently,
using the inWarningGroup prop.
A mochitest is added to make sure this works as expected, and
a mocha test case as well to make sure the WarningGroup for
tracking protection messages looks like it should.

The grouping won't occur unless the groupWarnings preferences
is on.

Depends on D23551

Attachment #9051054 - Attachment description: Bug 1524276 - Group tracking protection messages. r=bgrins. → Bug 1524276 - Group content blocking messages. r=bgrins.
Attachment #9051054 - Attachment description: Bug 1524276 - Group content blocking messages. r=bgrins. → Bug 1524276 - Group content blocking messages. r=bgrins, Honza!.
Attachment #9051047 - Attachment is obsolete: true
Attachment #9051054 - Attachment description: Bug 1524276 - Group content blocking messages. r=bgrins, Honza!. → Bug 1524276 - Group content blocking messages. r=bgrins,Honza!.
Pushed by nchevobbe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d21159afd969
Expose `category` and `innerWindowID` properties in ConsoleMessage. r=bgrins.
https://hg.mozilla.org/integration/autoland/rev/8bbe3e4f5a54
Add groupWarnings preference in console redux state. r=bgrins.
https://hg.mozilla.org/integration/autoland/rev/1fee0c357772
Add WarningGroup message component. r=bgrins.
https://hg.mozilla.org/integration/autoland/rev/47363a80ef6d
Group content blocking messages. r=bgrins,Honza.

Backed out 4 changesets (Bug 1524276) for mochitest-devtools failure at devtools/client/webconsole/test/fixtures/stub-generators/browser_webconsole_check_stubs_console_api.js. On a CLOSED TREE

Push with failures: https://treeherder.mozilla.org/#/jobs?repo=autoland&resultStatus=testfailed%2Cbusted%2Cexception&classifiedState=unclassified&selectedJob=236851695&revision=47363a80ef6d1e7a43a2325d32fe024c205cd001

Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=236845888&repo=autoland&lineNumber=3206

Backout link: https://treeherder.mozilla.org/#/jobs?repo=autoland&resultStatus=testfailed%2Cbusted%2Cexception&classifiedState=unclassified&selectedJob=236851695&revision=e365c225e26ae4c06d3346939b0c1ec9333d727a

[task 2019-03-29T09:14:22.048Z] 09:14:22 INFO - TEST-PASS | devtools/client/webconsole/test/fixtures/stub-generators/browser_webconsole_check_stubs_console_api.js | wrapper exists -
[task 2019-03-29T09:14:22.049Z] 09:14:22 INFO - Console message: [JavaScript Warning: "Array.map is deprecated; use Array.prototype.map instead" {file: "resource://devtools/server/actors/webconsole.js" line: 1711}]
[task 2019-03-29T09:14:22.049Z] 09:14:22 INFO - Buffered messages logged at 09:14:17
[task 2019-03-29T09:14:22.049Z] 09:14:22 INFO - Console message: [JavaScript Warning: "onmozfullscreenchange is deprecated." {file: "http://example.com/browser/devtools/client/webconsole/test/fixtures/stub-generators/test-console-api.html" line: 0}]
[task 2019-03-29T09:14:22.051Z] 09:14:22 INFO - Console message: [JavaScript Warning: "onmozfullscreenerror is deprecated." {file: "http://example.com/browser/devtools/client/webconsole/test/fixtures/stub-generators/test-console-api.html" line: 0}]
[task 2019-03-29T09:14:22.053Z] 09:14:22 INFO - Buffered messages logged at 09:14:21
[task 2019-03-29T09:14:22.054Z] 09:14:22 INFO - Removing tab.
[task 2019-03-29T09:14:22.054Z] 09:14:22 INFO - Waiting for event: 'TabClose' on [object XULElement].
[task 2019-03-29T09:14:22.054Z] 09:14:22 INFO - Got event: 'TabClose' on [object XULElement].
[task 2019-03-29T09:14:22.055Z] 09:14:22 INFO - Tab removed and finished closing
[task 2019-03-29T09:14:22.059Z] 09:14:22 INFO - Buffered messages finished
[task 2019-03-29T09:14:22.060Z] 09:14:22 INFO - TEST-UNEXPECTED-FAIL | devtools/client/webconsole/test/fixtures/stub-generators/browser_webconsole_check_stubs_console_api.js | The consoleApi stubs file needs to be updated by running mach test devtools/client/webconsole/test/fixtures/stub-generators/browser_webconsole_update_stubs_console_api.js -
[task 2019-03-29T09:14:22.060Z] 09:14:22 INFO - Stack trace:
[task 2019-03-29T09:14:22.062Z] 09:14:22 INFO - chrome://mochikit/content/browser-test.js:test_ok:1304
[task 2019-03-29T09:14:22.063Z] 09:14:22 INFO - chrome://mochitests/content/browser/devtools/client/webconsole/test/fixtures/stub-generators/browser_webconsole_check_stubs_console_api.js:null:17
[task 2019-03-29T09:14:22.063Z] 09:14:22 INFO - chrome://mochikit/content/browser-test.js:Tester_execTest/<:1106
[task 2019-03-29T09:14:22.063Z] 09:14:22 INFO - chrome://mochikit/content/browser-test.js:Tester_execTest:1134
[task 2019-03-29T09:14:22.063Z] 09:14:22 INFO - chrome://mochikit/content/browser-test.js:nextTest/<:995
[task 2019-03-29T09:14:22.063Z] 09:14:22 INFO - chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:SimpleTest.waitForFocus/waitForFocusInner/focusedOrLoaded/<:803
[task 2019-03-29T09:14:22.063Z] 09:14:22 INFO - Leaving test bound

Flags: needinfo?(nchevobbe)

Not sure what happened, I rebased, generated stubs again and pushed to try https://treeherder.mozilla.org/#/jobs?repo=try&revision=16cb74c9b88600dc6222b77fee3eb31849b6901c to make sure everything is okay (but maybe there's a patch on autoland messing with this?)

Flags: needinfo?(nchevobbe)
Pushed by nchevobbe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/6f1c417146be
Expose `category` and `innerWindowID` properties in ConsoleMessage. r=bgrins.
https://hg.mozilla.org/integration/autoland/rev/9476f9253c9c
Add groupWarnings preference in console redux state. r=bgrins.
https://hg.mozilla.org/integration/autoland/rev/30570673a894
Add WarningGroup message component. r=bgrins.
https://hg.mozilla.org/integration/autoland/rev/78fb95dc20e3
Group content blocking messages. r=bgrins,Honza.

Backed out 4 changesets (Bug 1524276) for mochitest-devtools at devtools/client/webconsole/test/fixtures/stub-generators/browser_webconsole_check_stubs_console_api.js. On a CLOSED TREE

Push with failures: https://treeherder.mozilla.org/#/jobs?repo=autoland&resultStatus=testfailed%2Cbusted%2Cexception&classifiedState=unclassified&searchStr=dt2&revision=78fb95dc20e388a616adf8ec31c9dd652a0c8b55

Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=236919615&repo=autoland&lineNumber=3201

Backout link: https://treeherder.mozilla.org/#/jobs?repo=autoland&resultStatus=testfailed%2Cbusted%2Cexception&classifiedState=unclassified&searchStr=dt2&revision=7f9e2ce2bf14b4be1ab91cc0f72159ed5f3c7328

task 2019-03-29T15:30:33.809Z] 15:30:33 INFO - Tab removed and finished closing
[task 2019-03-29T15:30:33.810Z] 15:30:33 INFO - Buffered messages finished
[task 2019-03-29T15:30:33.812Z] 15:30:33 INFO - TEST-UNEXPECTED-FAIL | devtools/client/webconsole/test/fixtures/stub-generators/browser_webconsole_check_stubs_console_api.js | The consoleApi stubs file needs to be updated by running mach test devtools/client/webconsole/test/fixtures/stub-generators/browser_webconsole_update_stubs_console_api.js -
[task 2019-03-29T15:30:33.813Z] 15:30:33 INFO - Stack trace:
[task 2019-03-29T15:30:33.813Z] 15:30:33 INFO - chrome://mochikit/content/browser-test.js:test_ok:1304
[task 2019-03-29T15:30:33.814Z] 15:30:33 INFO - chrome://mochitests/content/browser/devtools/client/webconsole/test/fixtures/stub-generators/browser_webconsole_check_stubs_console_api.js:null:17
[task 2019-03-29T15:30:33.815Z] 15:30:33 INFO - chrome://mochikit/content/browser-test.js:Tester_execTest/<:1106
[task 2019-03-29T15:30:33.815Z] 15:30:33 INFO - chrome://mochikit/content/browser-test.js:Tester_execTest:1134
[task 2019-03-29T15:30:33.815Z] 15:30:33 INFO - chrome://mochikit/content/browser-test.js:nextTest/<:995
[task 2019-03-29T15:30:33.815Z] 15:30:33 INFO - chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:SimpleTest.waitForFocus/waitForFocusInner/focusedOrLoaded/<:803
[task 2019-03-29T15:30:33.815Z] 15:30:33 INFO - Leaving test bound
[task 2019-03-29T15:30:33.815Z] 15:30:33 INFO - GECKO(2025) | MEMORY STAT vsizeMaxContiguous not supported in this build configuration.
[task 2019-03-29T15:30:33.815Z] 15:30:33 INFO - GECKO(2025) | MEMORY STAT heapAllocated not supported in this build configuration.
[task 2019-03-29T15:30:33.816Z] 15:30:33 INFO - GECKO(2025) | MEMORY STAT | vsize 20973941MB | residentFast 1168MB
[task 2019-03-29T15:30:33.816Z] 15:30:33 INFO - TEST-OK | devtools/client/webconsole/test/fixtures/stub-generators/browser_webconsole_check_stubs_console_api.js | took 8379ms
[task 2019-03-29T15:30:33.816Z] 15:30:33 INFO - checking window state
[task 2019-03-29T15:30:33.816Z] 15:30:33 INFO - TEST-START | devtools/client/webconsole/test/fixtures/stub-generators/browser_webconsole_check_stubs_css_message.js
[task 2019-03-29T15:30:35.424Z] 15:30:35 INFO - GECKO(2025) | console.warn: "Error while detaching the thread front: 'detach' request packet to 'server1.conn1.child1/context18' can't be sent as the connection is closed."
[task 2019-03-29T15:30:35.863Z] 15:30:35 INFO - GECKO(2025) | MEMORY STAT | vsize 20973962MB | residentFast 1164MB
[task 2019-03-29T15:30:35.863Z] 15:30:35 INFO - TEST-OK | devtools/client/webconsole/test/fixtures/stub-generators/browser_webconsole_check_stubs_css_message.js | took 2278ms
[task 2019-03-29T15:30:35.904Z] 15:30:35 INFO - checking window state
[task 2019-03-29T15:30:35.932Z] 15:30:35 INFO - TEST-START | devtools/client/webconsole/test/fixtures/stub-generators/browser_webconsole_check_stubs_evaluation_result.js
[task 2019-03-29T15:30:37.433Z] 15:30:37 INFO - GECKO(2025) | console.warn: "Error while detaching the thread front: 'detach' request packet to 'server1.conn2.child1/context18' can't be sent as the connection is closed."
[task 2019-03-29T15:30:37.812Z] 15:30:37 INFO - GECKO(2025) | MEMORY STAT | vsize 20973996MB | residentFast 1186MB
[task 2019-03-29T15:30:37.812Z] 15:30:37 INFO - TEST-OK | devtools/client/webconsole/test/fixtures/stub-generators/browser_webconsole_check_stubs_evaluation_result.js | took 1874ms
[task 2019-03-29T15:30:37.851Z] 15:30:37 INFO - checking window state

Flags: needinfo?(nchevobbe)

Erf, sorry about that. TRY was fine :/
I'll try to debug that

Flags: needinfo?(nchevobbe)
Pushed by nchevobbe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/a4510b32d7cf
Expose `category` and `innerWindowID` properties in ConsoleMessage. r=bgrins.
https://hg.mozilla.org/integration/autoland/rev/86c8bac38c31
Add groupWarnings preference in console redux state. r=bgrins.
https://hg.mozilla.org/integration/autoland/rev/7601da9b8556
Add WarningGroup message component. r=bgrins.
https://hg.mozilla.org/integration/autoland/rev/70bb5bea489c
Group content blocking messages. r=bgrins,Honza.
Depends on: 1540546
Flags: qe-verify+

Hello,
Reproduced the issue using Firefox 67.0a1 (20190131214909) on Windows 10 x64.
The issue is verified fixed using Firefox 68.0b13 (20190624133534) and Firefox 69.0a1 (20190626215508) on Windows 10x64, macOS 10.14 and Ubuntu 18.04.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
Blocks: 1535099
You need to log in before you can comment on or make changes to this bug.