MV3 Extension not working

I’ve created a very simple test extension using manifest V3 that works in chrome

manifest.json:

{
  "manifest_version": 3,
  "name": "test",
  "version": "0.0.1",
  "content_scripts": [
    {
      "matches": ["*://*/*"],
      "js": ["content.js"]
    }
  ]
}

content.js:

alert('test')

I tried running

web-ext run --firefox-preview

A browser window opens, but the extension is not working…
Using the --verbose option I find these errors

 Firefox stderr: [Parent 14212, IPC I/O Parent] WARNING: file /builds/worker/checkouts/gecko/ipc/chromium/src/base/process_util_win.cc:167
 Firefox stderr: JavaScript error: resource://gre/modules/XULStore.jsm, line 58: Error: Can't find profile directory.
 Firefox stdout: console.error: services.settings:
 Firefox stdout: main/whats-new-panel Signature failed  InvalidSignatureError: Invalid content signature (main/whats-new-panel)
 Firefox stdout: console.error: services.settings:
 Firefox stdout: main/whats-new-panel local data was corrupted
console.warn: services.settings: main/whats-new-panel Signature verified failed. Retry from scratch
 Firefox stdout: console.error: services.settings:
 Firefox stdout: main/addons-manager-settings Signature failed again InvalidSignatureError: Invalid content signature (main/addons-manager-settings)
 Firefox stdout: console.error: services.settings:
 Firefox stdout: Message: InvalidSignatureError: Invalid content signature (main/addons-manager-settings)
  Stack:
    InvalidSignatureError@resource://services-settings/RemoteSettingsClient.jsm:169:5
_validateCollectionSignature@resource://services-settings/RemoteSettingsClient.jsm:977:13

Also if I change the manifest version to 2 the extension works even in Firefox… what am I doing wrong?

Host permissions now needs to be granted by the user manually for each page… or something like that:

See also:

1 Like

I’m not seeing any permissions tab; at least, tapping “Permissions” doesn’t prompt me for anything. It just takes me to a link “Learn about permissions”.

That applies only to desktop Firefox.

Firefox for Android is a bit “behind” regarding addons support :slight_smile:.

Any idea when we can expect add-ons for Android Firefox to be ready for testing? As you can imagine, my users are clamoring for a mobile solution.

Can’t say, but the MV2 addons are allowed in Beta version, although it’s more like a “workaround”, so not suitable for normal users.

See for example this article:
https://www.ghacks.net/2022/10/20/firefox-beta-for-android-now-supports-custom-add-on-collections/

Thanks for the link. Unfortunately, it didn’t help much because my extension is brand new and therefore isn’t in the add-ons store, hence it doesn’t have a collection ID (if you can all a single extension a “collection”).