Closed Bug 1872890 Opened 9 months ago Closed 5 months ago

Content scripts don't work in manifest v3

Categories

(Fenix :: WebExtensions, defect, P2)

Firefox 123
All
Android
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: bavoyop428, Unassigned)

References

Details

(Whiteboard: [addons-jira])

Attachments

(1 file)

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.

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

I can confirm this issue. It is affecting me too...

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

The severity field is not set for this bug.
:amejia, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(amejiamarmol)
Severity: -- → N/A
Flags: needinfo?(amejiamarmol)
Priority: -- → P5

The severity field is not set for this bug.
:amejia, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(amejiamarmol)

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.

Severity: N/A → S4
Flags: needinfo?(amejiamarmol)

I'm confused with the S4 rating...

It is not cosmetic or trivial. Extensions using Manifest V3 can't run.

Thanks for point it out,
Sorry my bad, I updated it.

Severity: S4 → S1
Priority: P5 → P1

Clearing tracking request's since they were automatically added when setting an S1 severity

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.

Priority: P2 → P1

I'm not qualified but by reading the description of the ratings, I'd guess this is P2 or P3 and S2.

Gah, my previous intent was to set P2.

Severity: S1 → S2
Priority: P2 → --
Priority: -- → P2

I think this Bug blocks this Meta Bug.
Bug 1812119 [Meta] Fenix MV3

Depends on: fenix-mv3
Whiteboard: [addons-jira]

Will please when you some availability add related ticket.

Flags: needinfo?(wdurand)
Depends on: 1889402
No longer depends on: fenix-mv3
Flags: needinfo?(wdurand)

This looks fixed by Bug 1889402, for which the newly introduced pref was enabled for both Firefox for desktop and Firefox for Android.

Status: UNCONFIRMED → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: