# Deploying the Nexthink browser extension on Firefox via JSON

This page explains how to force-install Firefox extensions on managed Windows and macOS devices using the `policies.json` configuration file. [Firefox Enterprise Policies](https://support.mozilla.org/en-US/kb/customizing-firefox-using-policiesjson) enable administrators to deploy extensions, enforce settings, and consistently manage the browser experience across various environments.

While the method is cross-platform, file paths and deployment steps vary slightly across different operating systems.​

***

## Prerequisites <a href="#prerequisites" id="prerequisites"></a>

Before deployment, ensure you have the following:

* Your Firefox extension, packaged as a `.xpi` file.
* A reliable location from which all target machines can access the extension:
  * Local file system path87900
  * Network share (UNC path)
  * HTTPS-hosted download URL
* The correct Extension IDs depending on environment:
  * Prod: `{393c57f8-28d9-11eb-8f58-3b6871335926}`
  * Beta: `{1a5fb18a-1b9b-11ec-a3c7-138a3aa5faee}`

***

## Creating the `policies.json` file <a href="#creating-the-policies.json-file" id="creating-the-policies.json-file"></a>

The `policies.json` file must contain configuration entries for both extension installation and optional consent behavior.

Below are sample policy files for both macOS and Windows operating systems. Update file paths as necessary for your environment.

Note that the flag `appex-firefox-consent` should be set to `true` if you want to override user consent and force approval of the extension for the EULA (End-User License Agreement). Set it to `false` if you want your users to explicitly provide consent.​

***

### Configuration examples for `policies.json` <a href="#configuration-examples-for-policies.json" id="configuration-examples-for-policies.json"></a>

#### **Windows example**

```json
{
  "policies": {
    "3rdparty": {
      "Extensions": {
        "<extension-id>": {
          "appex-firefox-consent": false
        }
      }
    },
    "ExtensionSettings": {
      "<extension_id>": {
        "force_install": true,
        "install_url": "<extension_url>"
      }
    }
  }
}
```

#### **macOS example**

```json
{
  "policies": {
    "3rdparty": {
      "Extensions": {
        "<extension-id>": {
          "appex-firefox-consent": false
        }
      }
    },
    "ExtensionSettings": {
      "<extension_id>": {
        "force_install": true,
        "install_url": "<extension_url>"
      }
    }
  }
}
```

When configuring `policies.json`, keep the following in mind:

* Use forward slashes and full paths for file URLs, even on Windows.
* Do not use zipped `.xpi.zip` files; Firefox expects direct `.xpi` files.
* HTTPS-hosted install URLs are supported (e.g., `"install_url": "https://internal.example.com/extensions/my_extension.xpi"`).

***

## Deploying the `policies.json` file <a href="#deploying-the-policies.json-file" id="deploying-the-policies.json-file"></a>

### Windows <a href="#windows" id="windows"></a>

1. Locate the Firefox installation folder:
   * Standard installation:

     ```
     C:\Program Files\Mozilla Firefox\
     ```
   * 32-bit on 64-bit systems or alternate installs:

     ```
     C:\Program Files (x86)\Mozilla Firefox\
     ```
2. Create the `distribution` folder:

   ```cmd
   mkdir "C:\Program Files\Mozilla Firefox\distribution"
   ```
3. Copy the `policies.json` file into the folder (Run as Administrator):

   ```cmd
   copy policies.json "C:\Program Files\Mozilla Firefox\distribution\"
   ```
4. Restart Firefox. The specified extension will install automatically.

### macOS

1. Locate the Firefox application folder:

   ```
   /Applications/Firefox.app
   ```
2. Create the `distribution` directory if it does not exist:

   ```bash
   sudo mkdir -p /Applications/Firefox.app/Contents/Resources/distribution/
   ```
3. Copy the `policies.json` file into the directory:

   ```bash
   sudo cp policies.json /Applications/Firefox.app/Contents/Resources/distribution/
   ```

In some cases, manually copying the file may be required if the command fails.

4. Restart Firefox. The extension will install automatically and appear locked in the browser.

***

## Deploying the extension using a `.plist` file

Alternatively, instead of using a `policies.json` file, you can deploy the Nexthink browser extension through a `.plist` file in `.xml` format. Note that the file path may vary depending on the browser you use.

#### File example

```xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>EnterprisePoliciesEnabled</key>
    <true/>
    <key>Certificates</key>
    <dict>
      <key>ImportEnterpriseRoots</key>
      <true/>
    </dict>
    <key>ExtensionSettings</key>
    <dict>
      <key>{extension-id}</key>
      <dict>
        <key>installation_mode</key>
        <string>force_installed</string>
        <key>install_url</key>
        <string>https://ffextension.nexthink.com/nexthink-latest-an-fx-beta.xpi</string>
      </dict>
    </dict>
    <key>3rdparty</key>
    <dict>
      <key>Extensions</key>
      <dict>
        <key>{extension-id}</key>
        <dict>
          <key>appex-firefox-consent</key>
          <true/>
        </dict>
      </dict>
    </dict>
  </dict>
</plist>
```

***

## Troubleshooting

In case you encounter problems during this process, the following actions may help you resolve them:

* Double-check all file paths. They must be accessible by the logged-in user.
* Ensure the extension is a valid `.xpi` file. Zipped versions may not install correctly.
* Ensure you are using the correct Extension ID. (See [#prerequisites](#prerequisites "mention"))
* To diagnose errors, open the following page in Firefox:

  ```
  about:policies
  ```
* For shared deployments, use UNC paths (e.g., `file://server/share/extension.xpi`) or web-hosted URLs.
* Ensure that the `policies.json` or `.plist` file and the extension files are readable by Firefox.

***

RELATED TOPICS

* [Installing the Nexthink Browser Extension](https://docs.nexthink.com/platform/configuring_nexthink/bringing-data-into-your-nexthink-instance/deploying-nexthink-in-non-vdi-environment/installing-the-nexthink-browser-extension)
