搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

了解更多

ExtensionSettings policy

  • 5 回覆
  • 0 有這個問題
  • 65 次檢視
  • 最近回覆由 Damon

more options

We're exploring adopting a default deny policy for Firefox extensions in our enterprise. However when I tested this by creating a custom policies.json Firefox unexpectedly removed all extensions for me, including the ones I thought I had allow listed. Here is my policies.json but just keeping in the Facebook Container add-on to illustrate:

{

   "policies": {
       "ExtensionSettings": {
           "*": {
               "blocked_install_message": "Only approved Firefox extensions can be installed, please email your request to itdept@example.org",
               "installation_mode": "blocked",
               "allowed_types": ["theme", "dictionary", "locale"]
           },
           "@contain-facebook.xpi": { "installation_mode": "allowed" }
       }
   }

}

What I would like is to to allow pre-approved extensions (including if they already are installed) and all other types of add-on, but remove and prohibit installation of unapproved extensions.

Can anyone assist, please?

We're exploring adopting a default deny policy for Firefox extensions in our enterprise. However when I tested this by [[Customize Firefox using policies.json|creating a custom policies.json]] Firefox unexpectedly removed all extensions for me, including the ones I thought I had allow listed. Here is my policies.json but just keeping in the Facebook Container add-on to illustrate: { "policies": { "ExtensionSettings": { "*": { "blocked_install_message": "Only approved Firefox extensions can be installed, please email your request to itdept@example.org", "installation_mode": "blocked", "allowed_types": ["theme", "dictionary", "locale"] }, "@contain-facebook.xpi": { "installation_mode": "allowed" } } } } What I would like is to to allow pre-approved extensions (including if they already are installed) and all other types of add-on, but remove and prohibit installation of unapproved extensions. Can anyone assist, please?

被選擇的解決方法

So if you remove

             "installation_mode": "blocked",

It should work as you expect.

The allowed_types line is effectively acting as if everything is blocked.

That being said, there probably is a bug here, because blocking everything causes other things to happen, and you probably want that.

從原來的回覆中察看解決方案 👍 1

所有回覆 (5)

more options

It's this line:

              "allowed_types": ["theme", "dictionary", "locale"]

You really don't even need that, so you can just remove.

The problem is you didn't put extensions on that list so they aren't allowed...

And also the ID for the Facebook container is just @contain-facebook

I wrote an extension that helps you find IDs from any page on AMO:

https://github.com/mkaply/queryamoid/releases/tag/v0.2

有幫助嗎?

more options

Thanks, Mike. Rookie mistake with the ID. I actually ended up following this StackOverflow advice to use about:debugging which seems to achieve the same.

However I still can't get allowed_types to work the way I think it should. What I want to happen is default allow for all dictionary, locale and theme add-ons, but default deny for extension add-ons unless the ID is included explicitly. My reading of the documentation is

"*": { "allowed_types": ["theme", "dictionary", "locale"] }

should provide for this. So for example the below configuration allows the Facebook Container extension but denies all other add-ons including dictionaries, when what I want is for all dictionaries to be allowed:

{

  "policies": {
      "ExtensionSettings": {
          "*": {
              "blocked_install_message": "Only approved Firefox extensions can be installed, please email your request to itdept@example.org",
              "installation_mode": "blocked",
              "allowed_types": ["dictionary"]
          },
          "@contain-facebook": { "installation_mode": "allowed" }
      }
  }

}

有幫助嗎?

more options

選擇的解決方法

So if you remove

             "installation_mode": "blocked",

It should work as you expect.

The allowed_types line is effectively acting as if everything is blocked.

That being said, there probably is a bug here, because blocking everything causes other things to happen, and you probably want that.

有幫助嗎?

more options

My recollection is that I tested this against Chrome and it worked the same, but I'll double check.

有幫助嗎?

more options

Thanks, now I understand. For the archives, this is what works for me:

{

   "policies":
   {
       "ExtensionSettings": {
           "*": {
               "blocked_install_message": "Only approved Firefox extensions can be installed, please email your request to itdept@example.org",
               "allowed_types": ["theme", "dictionary", "locale"]
           },
           "@contain-facebook": { "installation_mode": "allowed" }
       }
   }

}

有幫助嗎?

問個問題

如果您還沒有帳號,您必須先登入帳號 來回覆文章。還沒有帳號的話,只能發問新問題