Content scripts don't work in manifest v3
Categories
(Fenix :: WebExtensions, defect, P2)
Tracking
(Not tracked)
People
(Reporter: bavoyop428, Unassigned)
References
Details
(Whiteboard: [addons-jira])
Attachments
(1 file)
30.15 KB,
image/png
|
Details |
Steps to reproduce:
Create a simple Add-on with a manifest like so:
"manifest_version": 2,
"content_scripts": [
{
"matches": [ "example.com" ],
"js": [ "example.js" ]
}
]
On every version of Firefox, the example.js
script will be injected on the example.com
website.
Now change to manifest v3:
"manifest_version": 3,
"content_scripts": [
{
"matches": [ "example.com" ],
"js": [ "example.js" ]
}
]
When using the desktop version of Firefox, Firefox will prompt whether to allow execution of the Add-on (see attached image). On Firefox for Android this does not happen.
Here's a link for the source of my Add-on. After the change back to v2 everything works as expected: annas-goodreads on GitHub.
Here's my question on Stackoverflow regarding this issue: https://stackoverflow.com/questions/77753827/manifest-v3-on-firefox-for-android
Actual results:
The content script does not load. I've tested on both stable and nightly releases. I've used the Firefox debugging over USB to verify that the Add-on does not print anything to the console.
If you first install the v2 extension and then install the v3 extension right after, the Add-on runs as expected (I assume Firefox remembers the automatically granted permission). If you remove the v2 Add-on first or install the v3 Add-on directly, the script does not run.
Expected results:
The content script should either run automatically like it did in v2 or the browser should ask for permission like it does on the desktop version for v3.
Reporter | ||
Comment 1•11 months ago
|
||
Apparently I'm not the only one having this issue. On Stackoverflow somebody figured out that the script is injected after the add-ons popup is opened (manifest key: action.default_popup
. Here's a link to the issue: https://stackoverflow.com/questions/75426674/firefox-nightly-android-add-on-content-script-loading-only-after-opening-add-on
And here's a link to a video where you can see the bug: https://youtu.be/cknXID7rV7k
Comment 3•11 months ago
|
||
This is (kinda) expected. MV3 support in Fenix is partial, which is why add-on developers are advised to use MV2 when targeting the Android platform: https://extensionworkshop.com/documentation/develop/developing-extensions-for-firefox-for-android/#mv3-compatibility
Comment 4•11 months ago
|
||
The severity field is not set for this bug.
:amejia, could you have a look please?
For more information, please visit BugBot documentation.
Updated•11 months ago
|
Comment 5•11 months ago
|
||
The severity field is not set for this bug.
:amejia, could you have a look please?
For more information, please visit BugBot documentation.
I would just like to point out that this bug prevent many extensions from working on Firefox for Android.
While it does not affect the core functionning of the browser, it does have a high impact on extensions.
Updated•10 months ago
|
I'm confused with the S4 rating...
It is not cosmetic or trivial. Extensions using Manifest V3 can't run.
Comment 8•10 months ago
|
||
Thanks for point it out,
Sorry my bad, I updated it.
Comment 9•10 months ago
|
||
Clearing tracking request's since they were automatically added when setting an S1 severity
Comment 10•10 months ago
|
||
This cannot be a P1. Work needs to happen in Desktop before we can fully add support for MV3 in Firefox for Android. This is something we'd like to work on this year, but I cannot share more details at the moment unfortunately.
Comment 11•10 months ago
|
||
I'm not qualified but by reading the description of the ratings, I'd guess this is P2 or P3 and S2.
Comment 12•10 months ago
|
||
Gah, my previous intent was to set P2.
Updated•10 months ago
|
Comment 13•10 months ago
|
||
I think this Bug blocks this Meta Bug.
Bug 1812119 [Meta] Fenix MV3
Updated•10 months ago
|
Updated•10 months ago
|
Comment 15•8 months ago
|
||
Will please when you some availability add related ticket.
Updated•8 months ago
|
Comment 16•7 months ago
|
||
This looks fixed by Bug 1889402, for which the newly introduced pref was enabled for both Firefox for desktop and Firefox for Android.
Description
•