Getting Started

You can find the source code of Enterprise Policy Generator here. To add new policies to Enterprise Policy Generator you have to extend the file /src/js/core/policies.js. That's all - Based only on this configuration file the Enterprise Policy Generator automatically generates the user interface and all the logic behind the scenes, including JSON output, save, load, import and export functionality.

Every policy extends the policies object and uses the name of the policy as property name. The value of the new property is an object with defined properties.

Example

const policies = {
  BlockAboutAddons : {
    first_available : { mainstream : '60.0', esr : '60.0' },
    ui_category : 'block-access',
    type : 'boolean'
  }
}  

The order of the policies in the Enterprise Policy Generator is defined by the ui_category and the order of the policies in the policies.js file.

Please add new translations to the /src/_locales/<LANG_CODE>/messages.json files. Add new translations to all language files and use English for languages you do not speak. Make sure that the alphabetical order of the translation keys is maintained.

Each policy has a description that appears next to the checkbox to enable the policy. The translation key for the description must use the following naming scheme:

policy_description_PolicyName, for example:

"policy_description_ExtensionSettings": {
  "message": "Manage the installation and uninstallation of add-ons"
}

All other translation keys for a policy should use the following naming scheme:

policy_description_PolicyName_VariableName, for example:

"policy_description_ExtensionSettings_allowed_types": {
  "message": "Allowed add-on types"
}

In the policies.js file you can use the following method to get a translated string:

browser.i18n.getMessage('policy_description_ExtensionSettings_allowed_types')

Last updated