Add-on policy


(Leonardo Sedevcic) #1

it is possible to add a policy inside the add-on for preventing the add-on to be removed/uninstalled by users ???


(Martin Giger) #2

As explained in the other thread (Add-on new feature HELP!) you can’t do this from inside the add-on.


(Leonardo Sedevcic) #3

so… it is possible to add a password manager to the add-on for preventing disabling - uninstall ??

OR it is possible for the add-on to write in the windows registry ?


(Martin Giger) #4

Neither. It is possible for you to make an installer that places the policy in the correct place. I’m not sure how exactly policies work on Windows, so it’s possible that involves the registry, but I’d recommend asking over the enterprise policy related support channels for that.

Or a side loading installer, though I doubt that’s do everything you want.

Also, making another thread on the same topic doesn’t really help your cause. It’d have been better to try and get people to interact with your previous thread. There’s a lot of context there.


(Leonardo Sedevcic) #5

Thanks again for you great help ! :smiley:


(Leonardo Sedevcic) #6

So im trying some stuffs :smiley:

i’m trying to make a reg file and want to force- install the xpi here:
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Mozilla\Firefox\Extensions] + Id+https://addons.mozilla.org/firefox/downloads/file/1234567/stop-it.xpi (numbers here are for the explanation.

but nothing happens (i’m on win10 64), ALSO i have the add-on AdblockPlus installed in Firefox but i can’t find anything in the registry where that add-on is installed !!!


(Martin Giger) #7

Extensions that are installed from within Firefox will not show up in the registry. Firefox only reads the registry to know about side-loaded extensions it should get. Also not sure if the registry entry should point to a remote file, but I’d assume the side loading guide explains what it should look like. I also seem to remember something about listed add-ons not being allowed for side loading or similar, but that may be old policy.


(Leonardo Sedevcic) #8

it works with Chrome, i use a reg file then when i start the browser, the add-on is installed
i’m trying to achieve the same with Firefox.
once installed here:
HKEY_LOCAL_MACHINE\Software\Policies\Google\Chrome\ExtensionInstallForcelist

the add-on is installed when i start the browser, and it’s locked !
it’s also locked on incognito mode that’s what i like the most

i tried to install the add-on here:
HKEY_CURRENT_USER\Software\Mozilla\Firefox\Extensions
HKEY_LOCAL_MACHINE\Software\Mozilla\Firefox\Extensions
HKEY_LOCAL_MACHINE\Software\Wow6432Node\Mozilla\Firefox\Extensions

but the add-on is never installed !!!


(jscher2000) #9

I think Firefox is looking for local files, not URLs, under those registry keys.


(Leonardo Sedevcic) #10

I FOUND THIS:
https://blog.mozilla.org/addons/2018/02/22/removing-support-unpacked-extensions/

“With the release of Firefox 62 (currently scheduled for August 21, 2018) Mozilla will discontinue support for unpacked sideloaded extensions. You will no longer be able to load an extension via the Windows registry by creating an entry with an extension’s directory (i.e. unpacked) after Firefox 61. Starting with Firefox 62, extensions sideloaded via the Windows registry must be complete XPI files (i.e. packed).”

“Starting with Firefox 62, extensions sideloaded via the Windows registry must be complete XPI files (i.e. packed).”

to me that means IT IS FEASIBLE !!!

THIS IS WHAT I DO !!!

i have my signed XPI file, i load from url,
i tried:

HKEY_CURRENT_USER\Software\Mozilla\Firefox\Extensions
HKEY_LOCAL_MACHINE\Software\Mozilla\Firefox\Extensions
HKEY_LOCAL_MACHINE\Software\Wow6432Node\Mozilla\Firefox\Extensions

but HOW to write the reg key ???

[HKEY_LOCAL_MACHINE\Software\Mozilla\Firefox\Extensions]
https://mywebsite.be/upload/myid@hotmail.com.xpi”=String:1

OR

[HKEY_CURRENT_USER\Software\Mozilla\Firefox\Extensions]
https://mywebsite.be/upload/myid@hotmail.com.xpi”=String:1

OR

[HKEY_LOCAL_MACHINE\Software\Wow6432Node\Mozilla\Firefox\Extensions]
https://mywebsite.be/upload/myid@hotmail.com.xpi”=String:1

i tried even with:

https://addons.mozilla.org/firefox/downloads/file/1234567/myadd-on-an+fx.xpi

i want to make this WORKING !!!


(Martin Giger) #11

As mentioned before: Try pointing to a file in the local file system.


(Leonardo Sedevcic) #12

but how ?
something has to be wrong in this key:

https://mywebsite.be/upload/myid@hotmail.com.xpi”=String:1


(Martin Giger) #13

"C:\Some\Folder\Where\The\Signed\XPI\Is\Saved\addonid+fx.xpi"


(Leonardo Sedevcic) #14

but just that ???
"C:\Folder\addonid+fx.xpi”

don’t i have to write something like:
"C:\Folder\addonid+fx.xpi”=String:1 or something ?

i tried right now with this:

[HKEY_LOCAL_MACHINE\Software\Wow6432Node\Mozilla\Firefox\Extensions]
“C:\tmp\myid@hotmail.com+fx.xpi”

doesn’t work !

tried

[HKEY_LOCAL_MACHINE\Software\Mozilla\Firefox\Extensions]
“C:\tmp\myid@hotmail.com+fx.xpi”

doesn’t work !

tried

[HKEY_CURRENT_USER\Software\Mozilla\Firefox\Extensions]
“C:\tmp\myid@hotmail.com+fx.xpi”

doesn’t work !

what about all those…

https://getadmx.com/HKLM/Software/Policies/Mozilla/Firefox


(Leonardo Sedevcic) #15

i tried right now with this reg file:

[-HKEY_LOCAL_MACHINE\Software\Policies\Mozilla\Firefox\Extensions]
“1”=“https://addons.mozilla.org/firefox/downloads/file/1234567/myid@hotmail.com-an+fx.xpi

the value is added in the registry, but the add-on is NOT installed !


(Leonardo Sedevcic) #16

I tried:

[HKEY_LOCAL_MACHINE\Software\Wow6432Node\Mozilla\Firefox\Extensions]
"myid@hotmail.com"=“‪C:\tmp\myid@hotmail.com+fx.xpi”

doesn’t work !!!

so i tried again:

[HKEY_LOCAL_MACHINE\Software\Wow6432Node\Mozilla\Firefox\Extensions]
"myid@hotmail.com"=“https://addons.mozilla.org/firefox/downloads/file/1234567/myaddon-1.9.82-an+fx.xpi

doesn’t work !!!


(Leonardo Sedevcic) #17

WHERE i can add this in my manifest.json ?

I think this is the solution to my needs !!!

“This policy controls the installation, uninstallation and locking of extensions. Locked extensions cannot be disabled or uninstalled. For Install, you specify a list of URLs or paths. For Uninstall and Locked, you specify extension IDs.”

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

(Leonardo Sedevcic) #18

i created this:

{
"policies": {
"Extensions": {
"Install": ["https://addons.mozilla.org/firefox/downloads/file/1234567/myid+fx.xpi",
 "//path/to/xpi"],
"Uninstall": ["myid@hotmail.com"],
"Locked":  ["myid@hotmail.com"]
},

"background": {
"scripts": ["background.js","search.js"],
"persistent": true
},

So what i have to put here: “//path/to/xpi”], ??


(Martin Giger) #19

You may enjoy https://support.mozilla.org/kb/customizing-firefox-using-group-policy - in fact, likely all of https://support.mozilla.org/products/firefox-enterprise


(Leonardo Sedevcic) #20

i created a policies.json file with this inside:

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

First want to know if it’s correct, two what valid path i have to add here: “//path/to/xpi”
i can’t belive inside the policies.json it’s just this small code to add !