How To Add More Than One Policy?

User Help for Mozilla Firefox
Post Reply
billnotben
Posts: 21
Joined: March 14th, 2009, 10:31 am

How To Add More Than One Policy?

Post by billnotben »

It's simple enough to add a policy but how do you add more than one?
morat
Posts: 6403
Joined: February 3rd, 2009, 6:29 pm

Re: How To Add More Than One Policy?

Post by morat »

Do you mean adding multiple policies using the policies.json file?

Example:

Code: Select all

{
  "policies": {
    "DontCheckDefaultBrowser": true,
    "Homepage": {
      "StartPage": "homepage",
      "URL": "https://www.google.com/"
    },
    "NewTabPage": true
  }
}
More info: http://forums.mozillazine.org/viewtopic ... &t=3057471
Last edited by morat on September 21st, 2021, 10:25 pm, edited 1 time in total.
User avatar
jscher2000
Posts: 11742
Joined: December 19th, 2004, 12:26 am
Location: Silicon Valley, CA USA
Contact:

Re: How To Add More Than One Policy?

Post by jscher2000 »

The policies.json file uses JSON notation: https://www.w3schools.com/js/js_json_syntax.asp

In JSON, different properties of the object are separated by commas. These properties can themselves be objects. As an example that includes multiple policies, some of which are objects and some of which are just values, see:

https://github.com/mozilla/policy-templ ... ciesjson-3
billnotben
Posts: 21
Joined: March 14th, 2009, 10:31 am

Re: How To Add More Than One Policy?

Post by billnotben »

Thank you both.
You've given me something to scratch my head over.
User avatar
dickvl
Posts: 54145
Joined: July 18th, 2005, 3:25 am

Re: How To Add More Than One Policy?

Post by dickvl »

You can separate multiple policy rules by a comma.
There shouldn't be a comma directly before a closing bracket (}).
You can open a JSON file in a Firefox tab to let the built-in JSON viewer validate and display the file.
billnotben
Posts: 21
Joined: March 14th, 2009, 10:31 am

Re: How To Add More Than One Policy?

Post by billnotben »

Thanks, that's something else I didn't know.
Post Reply