mozilla / policy-templates

Policy Templates for Firefox
Mozilla Public License 2.0
1.12k stars 398 forks source link

ExtensionSettings and removing add-ons #1124

Open as-qwerty opened 1 week ago

as-qwerty commented 1 week ago

If I specify the following in Extension settings:

  "*": {
    "blocked_install_message": "message",
    "installation_mode": "blocked"

all installed extensions (except those listed in "installation_mode": "allowed") will be removed. This is correct.

but if I specify something like this:

  "*": {
    "blocked_install_message": "message",
    "installation_mode": "allowed",
    "allowed_types": ["locale","dictionary"]

all installed add-ons (except those listed in "installation_mode": "allowed", and any languages and dictionaries ) will be blocked (grayed out), but not removed. This is not obvious, because if I wanted to remove or block installed extensions (for the user it is the same thing), I would use "blocked".

Is it possible to specify what to do with extensions that are not explicitly described as "blocked" in the policy: "gray out" or "do nothing"?

mkaply commented 1 week ago

That actually sounds like a bug (that they aren't uninstalled)

Chrome introduced "removed" to explicitly remove things

https://support.google.com/chrome/a/answer/9867568?hl=en

Do you want them disabled or removed?

as-qwerty commented 4 days ago

It seems right to me: delete if I specified "blocked" and do nothing if I specified nothing. Otherwise "blocked" is identical to "not specified" I think there may be situations when you want to keep previously installed extensions for users, but not allow installation of new ones. Maybe add a separate ExtensionSettings option that would allow selecting the action for already installed extensions (remove, blocked or do nothing)? That would be more flexible.

mkaply commented 4 days ago

The tricky part is making this change without impacting the old behavior.

I wonder if I need to add a version flag to this JSON?

I'm going to look at Chrome to see exactly what they do.