Open Bug 1903438 Opened 5 months ago Updated 5 months ago

match_about_blank addon doesn't load in about:blank from window.open()

Categories

(WebExtensions :: General, defect, P3)

Firefox 127
defect

Tracking

(firefox127 affected, firefox128 affected, firefox129 affected)

Tracking Status
firefox127 --- affected
firefox128 --- affected
firefox129 --- affected

People

(Reporter: firefox, Unassigned)

References

Details

Attachments

(3 files)

Attached file manifest.json

Steps to reproduce:

  1. Save the attached files to disk
  2. Open about:debugging#/runtime/this-firefox
  3. Load temporary addon match_about_blank bug
  4. Open the attached HTML file index.html
  5. Press the window.open() button
  6. Open the web inspector Console

Actual results:

The extension content script doesn't inject in the page, and there's no log message from the extension.

Expected results:

Log message from the extension: "extension script top? true about:blank"

The extension content script does inject if you reload the page, or if you just load about:blank in a new tab.

This bug does not occur in Google Chrome.

Attached file script.js
Attached file index.html

Also, the document.readyState is "uninitialized", which is not a valid value: https://developer.mozilla.org/docs/Web/API/Document/readyState

The Bugbug bot thinks this bug should belong to the 'WebExtensions::Untriaged' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Product: Firefox → WebExtensions

Hello,

I reproduced the issue on the latest Nightly (129.0a1/20240619213942) and Beta (128.0b5/20240619092300) under Windows 10 x64 and Ubuntu 22.04 LTS. Also checked the latest Release (127.0.1/20240618110440) but the issue does not appear to occur there.

On Nightly and Beta, the script fails to get injected in the index.html page and an error is shown in the web console - Unable to load script: moz-extension://a19b0a00-4a53-4472-894b-172256407c72/script.js. The web console for the about:blank tab that opens as part of the STR does log “Hello world!”.

On Release, the script is injected in index.html, but shows a different message as opposed to what is expected in Comment 0 i.e. it shows extension script top? true and the path to the index.html file, instead of “extension script top? true about:blank”. On the about:blank tab that opens as part of the STR, the same message is logged as in the case of the other two browser versions.

Status: UNCONFIRMED → NEW
Ever confirmed: true

(In reply to Alex Cornestean from comment #5)

Hello,

I reproduced the issue on the latest Nightly (129.0a1/20240619213942) and Beta (128.0b5/20240619092300) under Windows 10 x64 and Ubuntu 22.04 LTS. Also checked the latest Release (127.0.1/20240618110440) but the issue does not appear to occur there.

On Nightly and Beta, the script fails to get injected in the index.html page and an error is shown in the web console - Unable to load script: moz-extension://a19b0a00-4a53-4472-894b-172256407c72/script.js. The web console for the about:blank tab that opens as part of the STR does log “Hello world!”.

On Release, the script is injected in index.html, but shows a different message as opposed to what is expected in Comment 0 i.e. it shows extension script top? true and the path to the index.html file, instead of “extension script top? true about:blank”. On the about:blank tab that opens as part of the STR, the same message is logged as in the case of the other two browser versions.

There may be a misunderstanding here. The issue is not whether the addon content script gets injected into the index.html page. The issue is whether the addon content script gets injected into the new tab created by window.open().

Thank you for the clarification !

I checked on Chrome to see how the extension should behave and then I re-tested and reproduced on the latest Nightly (129.0a1/20240620213827), Beta (128.0b5/20240619092300) and Release (127.0.1/20240618110440) under Windows 10 x64 and Ubuntu 22.04 LTS.

The script fails to inject in the about:blank tab and "extension script top? true about:blank" is not logged to console. Only “Hello world!” is logged.

This is a known issue: https://bugzilla.mozilla.org/show_bug.cgi?id=1486036#c3

I'll keep this bug open instead of marking it as a duplicate because this bug makes it obvious that the issue is not specific to iframes (bug 1486036 / bug 1415539).

Severity: -- → S3
Component: Untriaged → General
Priority: -- → P3
See Also: → 1486036, 1415539
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: