Closed Bug 1759496 Opened 3 years ago Closed 3 years ago

dFPI's state partitioning console logs are not shown when fission is enabled

Categories

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

defect

Tracking

()

RESOLVED FIXED
101 Branch
Tracking Status
firefox-esr91 --- unaffected
firefox98 --- wontfix
firefox99 --- wontfix
firefox100 --- wontfix
firefox101 --- fixed

People

(Reporter: emz, Assigned: timhuang)

References

(Regression)

Details

(Keywords: regression)

Attachments

(3 files)

When fission is enabled we don't show the dFPI state partitioning console logs. Setting fission.autostart to false fixes the issue.

https://developer.mozilla.org/en-US/docs/Web/Privacy/Storage_Access_Policy/Errors/CookiePartitionedForeign

STR:

  1. Go to https://senglehardt.com/test/dfpi/simple.html
  2. Open the devtools and switch to the "Console" tab

Expected behavior:
Warnings are logged for partitioned cookies / storage:
"Partitioned cookie or storage access was provided to “<URL>” because it is loaded in the third-party context and dynamic state partitioning is enabled."

Actual behavior:
No state partitioning warnings shown.

Tested on:
Firefox 98.0.1 (64-bit), Ubuntu 21.10

Mozregression result:

 6:29.23 INFO: Last good revision: 383986e2f5cb835a55c47bbd6e15d81035ca0784
 6:29.23 INFO: First bad revision: d6e8528f0a936df88369c71f4e390e31a4d621a1
 6:29.23 INFO: Pushlog:
https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=383986e2f5cb835a55c47bbd6e15d81035ca0784&tochange=d6e8528f0a936df88369c71f4e390e31a4d621a1

Points to Bug 1732358 which enabled Fission by default.

Assignee: nobody → tihuang
Status: NEW → ASSIGNED
Severity: -- → S2
Priority: -- → P1

Currently, we cannot send console message to a window that is not in the
same content process. The message will lose if the windowID is for a
window in another content process.

The patch implements that the message will be sent to the parent process
in order to dispatch to the correct content process if the windowID
targets a window in another content process.

Has Regression Range: --- → yes
Blocks: 1535451
Attachment #9267838 - Attachment description: Bug 1759496 - Part 1: Implement the support for nsContentUtils::ReportToConsoleByWindowID() to send the message to a window that is not in the same content process. r?smaug → Bug 1759496 - Part 1: Report content blocking to console in the parent process r?smaug

You might have missed bug 1535451 comment 30.

DevTools spawn one ErrorMessageWatcher [1] per WindowGlobal, that in the whole Tree of BrowsingContexts of the currently debugged tab.
This ErrorMessageWatcher will fetch cached messages via Services.console.getMessageArray() [2], and receive live messages via Services.console.registerListener [3]. Again, once per WindowGlobal. And it will filter out per WindowGlobal.

So, if these error messages were fired with the right window global ID, they would be correctly handled by DevTools.
The issue is that's the ErrorMessageWatcher for the iframe WindowGlobal that receives the error message.
But it will only proceed the messages with the iframe WindowGlobal ID [4].

    const ids = targetActor.windows.map(window =>
      WebConsoleUtils.getInnerWindowId(window)
    );
    return ids.includes(message.innerWindowID);

targetActor.windows, nowadays will be typicaly made of a single element array, which is the iframe window object.
And instead, the message is flagged with the top level WindowGlobal ID and ignored.

[1] https://searchfox.org/mozilla-central/rev/26a1b0fce12e6dd495a954c542bb1e7bd6e0d548/devtools/server/actors/resources/error-messages.js#35
[2] https://searchfox.org/mozilla-central/rev/26a1b0fce12e6dd495a954c542bb1e7bd6e0d548/devtools/server/actors/resources/utils/nsi-console-listener-watcher.js#48
[3] https://searchfox.org/mozilla-central/rev/26a1b0fce12e6dd495a954c542bb1e7bd6e0d548/devtools/server/actors/resources/utils/nsi-console-listener-watcher.js#49
[4] https://searchfox.org/mozilla-central/rev/26a1b0fce12e6dd495a954c542bb1e7bd6e0d548/devtools/server/actors/resources/error-messages.js#82-85

Attachment #9267838 - Attachment description: Bug 1759496 - Part 1: Report content blocking to console in the parent process r?smaug → Bug 1759496 - Part 1: Report content blocking to console directly from the iframe r?smaug
Pushed by tihuang@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/6c9886ec0b0f Part 1: Report content blocking to console directly from the iframe r=smaug,pbz https://hg.mozilla.org/integration/autoland/rev/824b989fb729 Part 2: Add a test to verify if the console message of partitioned storage was sent correctly. r=pbz https://hg.mozilla.org/integration/autoland/rev/29bd999e4c62 Disable test browser_webconsole_warning_group_storage_isolation.js. r=nchevobbe
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 101 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: