Closed Bug 1848346 Opened 1 year ago Closed 1 year ago

scripting.getRegisteredContentScripts() does not work in the chrome namespace, only browser

Categories

(WebExtensions :: Untriaged, defect)

Firefox 115
defect

Tracking

(firefox116 affected, firefox117 affected, firefox118 affected)

RESOLVED INVALID
Tracking Status
firefox116 --- affected
firefox117 --- affected
firefox118 --- affected

People

(Reporter: dev, Unassigned)

References

Details

Attachments

(1 file)

(deleted), application/octet-stream
Details

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/115.0

Steps to reproduce:

Install a manifest v2 (untested on v3) browser extension with the "scripting" permission.

Go to addons:debugging

Inspect the background page

Run await chrome.scripting.getRegisteredContentScripts()

Actual results:

Returns undefined

Expected results:

Returns a list of registered content scripts

await browser.scripting.getRegisteredContentScripts() works as normal

Tested on Firefox 115 and 117

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 (118.0a1/20230813213352), Beta (117.0b7/20230813180142) and Release (116.0.2/20230805021307) under Windows 10 x64 and Ubuntu 22.04 LTS, using the attached extension.

Running await chrome.scripting.getRegisteredContentScripts() does indeed return “undefined”, however, the second snippet mentioned under the “Expected results” section of Comment 0 (await browser.scripting.getRegisteredContentScripts()) does work and returns an array.

Status: UNCONFIRMED → NEW
Ever confirmed: true
Attached file dark_mode.xpi (deleted) —

In MV3, the chrome namespace supports promises like Chrome does in MV3 (bug 1711570).
In MV2, the chrome namespace does not support promises for compatibility reasons.

This is working as intended.

Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: