Open Bug 1982934 Opened 10 months ago Updated 7 months ago

When navigating from an internal page, events of webRequest.filterResponseData() do not fire for main_frame responses.

Categories

(WebExtensions :: Request Handling, defect, P3)

Firefox 143
defect

Tracking

(Not tracked)

People

(Reporter: nines, Unassigned, NeedInfo)

References

Details

Attachments

(1 file)

717 bytes, application/x-zip-compressed
Details
Attached file example-extension.zip

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:142.0) Gecko/20100101 Firefox/142.0

Steps to reproduce:

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:143.0) Gecko/20100101 Firefox/143.0
Build ID: 20250813091044

  1. Load the attached extension via "about:debugging#/runtime/this-firefox".
  2. Click “Inspect” and open the console.
  3. Visit "https://www.google.com/" and verify that an ArrayBuffer is logged.
  4. Visit "about:preferences".
  5. Visit "https://www.google.com/" again.

Actual results:

Only the URL is logged.

Expected results:

The URL, an ArrayBuffer, and the string "closed" are logged.

The events do not fire because internally the request is considered redirected for some reason.

If you modify the test case and add filter.onerror = e => console.error(filter.error);

... then the displayed error is (confusingly) "Invalid request ID"
This error is confusing due to bug 1683862.

I tried out the STR with about:addons, about:config, about:preferences, about:logo can can confirm the observations.
On the other hand, on about:newtab, about:privatebrowsing, https://addons.mozilla.org/ the issue does not happen.

Based on this, I think that the actual issue is happening when a navigation is triggered from a tab in a non-remote process to a remote process.
To test this hypothesis, I set extensions.webextensions.remote to false in about:config, restarted Firefox, opened the manifest.json link of the extension, and indeed, the issue also reproduced there.

Next step here is to investigate what is happening and triage further.

Status: UNCONFIRMED → NEW
Ever confirmed: true
See Also: → 1683862

This bug also reminds me of bug 1806476, but that was about navigating from about:newtab or about:home to someplace else, and in the above comment I confirmed that this specific issue does not happen with about:newtab.

I'll investigate this a bit more.

Flags: needinfo?(rob)
See Also: → 1806476
Severity: -- → S3
Priority: -- → P3

I encountered this issue in UltimaDark WebExt and documented a workaround here:
https://github.com/ThomazPom/Moz-Ext-UltimaDark/issues/171#issuecomment-3563934115

Other Bugzilla reports where I’m confident it’s the same issue:
https://bugzilla.mozilla.org/show_bug.cgi?id=1561604
https://bugzilla.mozilla.org/show_bug.cgi?id=1806476

To isolate the problem, I tested every relevant about: page to determine which ones trigger the filter failure.
Here is the detailed overview:

initialUrl hasIssue hasIssueBool
about:blank No filter issue false
about:welcome No filter issue false
about:studies No filter issue false
about:protections No filter issue false
about:privatebrowsing No filter issue false
about:newtab No filter issue false
about:loginsimportreport No filter issue false
about:logins No filter issue false
about:home No filter issue false
about:compat No filter issue false
about:certificate No filter issue false
about:about Has filter issue true
about:windows-messages Has filter issue true
about:webrtc Has filter issue true
about:url-classifier Has filter issue true
about:unloads Has filter issue true
about:third-party Has filter issue true
about:telemetry Has filter issue true
about:sync-log Has filter issue true
about:support Has filter issue true
about:serviceworkers Has filter issue true
about:robots Has filter issue true
about:profiling Has filter issue true
about:profiles Has filter issue true
about:processes Has filter issue true
about:preferences Has filter issue true
about:policies Has filter issue true
about:networking Has filter issue true
about:mozilla Has filter issue true
about:memory Has filter issue true
about:logo Has filter issue true
about:logging Has filter issue true
about:license Has filter issue true
about:downloads Has filter issue true
about:debugging#/setup Has filter issue true
about:crashes Has filter issue true
about:config Has filter issue true
about:checkerboard Has filter issue true
about:cache Has filter issue true
about:buildconfig Has filter issue true
about:addons Has filter issue true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: