scripting.getRegisteredContentScripts() does not work in the chrome namespace, only browser
Categories
(WebExtensions :: Untriaged, defect)
Tracking
(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
Comment 1•1 year ago
|
||
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.
Comment 2•1 year ago
|
||
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.
Comment 3•1 year ago
|
||
Comment 4•1 year ago
|
||
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.
Description
•