Installation via policy

Due to the upcoming removal of side loading I’m in the process updating the installation process of our extension.

At first I was planning to use Extensions settings but as it has been superseded by ExtensionSettings I’m attempting to use that instead.

My problem is that I can’t get it to work, not even the example to install ublock origin works.

Are there any pre-reqs that have to be fulfilled to make this work? From what I understand from the documentation, just adding the JSON-data to the registry entry (REG_MULTI_SZ type) should be enough, right?

about:policies correctly lists the policy as active, but the extension is not installed.

Second question: How should updates be handled when the extension is installed from a local XPI-file? Is it enough to update the XPI-file, keeping the name?

I’m currently using FireFox 70.0.1 on Windows 10 (not domain joined if that matters)

Ok, I figured it out - do not put the “policies” and “ExtensionSettings” in the JSON.

The original example does not work:

{
  "policies": {
    "ExtensionSettings": {
      "*": {
        "blocked_install_message": "Custom error message.",
        "install_sources": ["https://addons.mozilla.org/"],
        "installation_mode": "blocked"
      },
      "uBlock0@raymondhill.net": {
        "installation_mode": "force_installed",
        "install_url": "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi"
      }
    }
  }
}

This modified version does:

{
       "*": {
        "blocked_install_message": "Custom error message.",
        "install_sources": ["https://addons.mozilla.org/"],
        "installation_mode": "blocked"
      },
      "uBlock0@raymondhill.net": {
        "installation_mode": "force_installed",
        "install_url": "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi"
      }
}
1 Like