Om de ûnderfining foar jo te ferbetterjen is tydlik de funksjonaliteit dan dizze website troch ûnderhâldswurk beheind. Wannear in artikel jo probleem net oplost en jo in fraach stelle wolle, kin ús stipemienskip jo helpe yn @FirefoxSupport op Twitter en /r/firefox op Reddit.

Sykje yn Support

Mij stipescams. Wy sille jo nea freegje in telefoannûmer te beljen, der in sms nei ta te stjoeren of persoanlike gegevens te dielen. Meld fertochte aktiviteit mei de opsje ‘Misbrûk melde’.

Mear ynfo

Dizze konversaasje is argivearre. Stel in nije fraach as jo help nedich hawwe.

An extension installed globally for all users (in /usr/share/mozilla/extensions) does not load for an unobvious reason

  • 1 antwurd
  • 1 hat dit probleem
  • 1 werjefte
  • Lêste antwurd fan zostajekni

more options

I need to automate the deployment of Firefox along with the extensions. I put three extensions (uBlock, Translate Web Pages, and Auto Tab Discard) in the /usr/share/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}/. All extensions load normally, except Auto Tab Discard. When running firefox with the -jsconsole option, I see what the screenshot shows (the message "Invalid addon ID"). But the installation to user profile is successful. I add the extension ID to manifest.json, and get the following output in the console: addons.xpi-utils WARN addMetadata: Add-on {c2c003ee-bd69-42a2-b0e9-6f34222cb046} is invalid: Error: File /usr/share/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}/{c2c003ee-bd69-42a2-b0e9-6f34222cb046} does not contain a valid manifest(resource://gre/modules/addons/XPIInstall.jsm:669:11) What can go wrong?

System: Debian 11 (bullseye) Firefox version: 91.4.1esr (amd64)

If you need any other information, please ask, I will write it down.

I need to automate the deployment of Firefox along with the extensions. I put three extensions (uBlock, Translate Web Pages, and Auto Tab Discard) in the /usr/share/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}/. All extensions load normally, except Auto Tab Discard. When running firefox with the -jsconsole option, I see what the screenshot shows (the message "Invalid addon ID"). But the installation to user profile is successful. I add the extension ID to manifest.json, and get the following output in the console: addons.xpi-utils WARN addMetadata: Add-on {c2c003ee-bd69-42a2-b0e9-6f34222cb046} is invalid: Error: File /usr/share/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}/{c2c003ee-bd69-42a2-b0e9-6f34222cb046} does not contain a valid manifest(resource://gre/modules/addons/XPIInstall.jsm:669:11) What can go wrong? System: Debian 11 (bullseye) Firefox version: 91.4.1esr (amd64) If you need any other information, please ask, I will write it down.
Keppele skermôfbyldingen

Bewurke troch zostajekni op

Keazen oplossing

The solution is found. There were two problems at once.

First, in order for the extension to be loaded by the browser, manifest.json (which is in the root of the directory with the extension) must have the following required minimum:

 {
   "manifest_version": 2,
   "name": "Extension Name",
   "version": "0.1.2",
   "applications": {
     "gecko": {
       "id": "{0a1b2c3d-0123-abcd-cdef-a0b1c2d3e4f5}"
     }
   }
 }


And the name of the .xpi file of the extension (which is actually a zip archive) or the directory with the unzipped extension must match the "id" value in manifest.json.

Secondly, it is necessary to check the permissions of the files and directories. In my case, the permissions of the extension directory, for some strange reason, were 700. At the same time, the extension did not have an "id" key in manifest.json, which additionally hindered diagnosis of the problem.

The illogical thing here is that when you install the extension in the user's profile, Firefox installs it without any problem, regardless of the invalid mainfest.json. There's no reason for this difference in behavior, it's just a headache for system administrators.

Dit antwurd yn kontekst lêze 👍 0

Alle antwurden (1)

more options

Keazen oplossing

The solution is found. There were two problems at once.

First, in order for the extension to be loaded by the browser, manifest.json (which is in the root of the directory with the extension) must have the following required minimum:

 {
   "manifest_version": 2,
   "name": "Extension Name",
   "version": "0.1.2",
   "applications": {
     "gecko": {
       "id": "{0a1b2c3d-0123-abcd-cdef-a0b1c2d3e4f5}"
     }
   }
 }


And the name of the .xpi file of the extension (which is actually a zip archive) or the directory with the unzipped extension must match the "id" value in manifest.json.

Secondly, it is necessary to check the permissions of the files and directories. In my case, the permissions of the extension directory, for some strange reason, were 700. At the same time, the extension did not have an "id" key in manifest.json, which additionally hindered diagnosis of the problem.

The illogical thing here is that when you install the extension in the user's profile, Firefox installs it without any problem, regardless of the invalid mainfest.json. There's no reason for this difference in behavior, it's just a headache for system administrators.

Bewurke troch zostajekni op