Lety
Lety

Reputation: 2603

Preinstalled Extension in FF 68.1.0esr doesn't work

I am preparing a firefox enterprise installation on windows server with a special configuration and a preinstalled extension. This is a single installation that will be used by all users accessing the server.

Here are the steps I followed:

  1. I installed firefox: Firefox_setup_68.1.0-esr.msi
  2. I transferred our policies.json file to C:\Program Files\Mozilla Firefox\distribution
  3. I transferred our autoconfig.js file to C:\Program Files\Mozilla Firefox\browser\defaults\preferences
  4. I transferred our [email protected]file to C:\Program Files\Mozilla Firefox\browser\extensions.

By running FireFox, I can see that both the policies and the configurations have been correctly considered, while the extension does not work.

After doing various tests I can say that:

So, given that the extension works, what's wrong with the preparation procedure, is the directory wrong or some configuration are missing?

Do preinstalled extensions need additional files or a different layout?

I also tried without our policies.json file and leaving only the directive that allows xpi file without signature in the autoconfig.json file.

Any help will be greatly appreciated, thanks

Upvotes: 1

Views: 580

Answers (1)

Lety
Lety

Reputation: 2603

Finally I found a syntax error in policies.json file and a missing section.

Following policies page it was not very clear to me what was //path/to/xpi. This is the examples:

"Extensions": {
     "Install": ["https://addons.mozilla.org/firefox/downloads/somefile.xpi", "//path/to/xpi"],
     "Uninstall": ["[email protected]"],
     "Locked":  ["[email protected]"]
   }

Finally I found that using a file url works.

Rereading the indicated page, I also noticed that the ExtensionSettings section was missing, fixing the path and adding this section now the extension is correctly installed and works!

Here is an examples of policies.json fixed:

{
  "policies": { 
    "Extensions": {
      "Install": ["file:///C:/Program Files/Mozilla Firefox/browser/extensions/[email protected]"],
      "Uninstall": [],
      "Locked":  []
    },
    "ExtensionSettings": {
      "*": {
        "blocked_install_message": "Custom error message.",
        "install_sources": ["https://addons.mozilla.org/"],
        "installation_mode": "blocked"
      },
      "[email protected]": {
        "installation_mode": "force_installed",
        "install_url": "file:///C:/Program Files/Mozilla Firefox/browser/extensions/[email protected]"
      }
    }
  }
}

Upvotes: 1

Related Questions