Install on Firefox for Windows or macOS using policies.json

Last updated:

This article covers the process to auto-install the Pendo Launcher extension on the Firefox web browser on a Windows or Mac computer using Mobile Device Management (MDM) tooling:

  1. Create an installation script for policies.json.
  2. Push your script to end-user devices.
  3. Validate that the installation was successful.

Before you continue, read our Plan your Adopt installation and IT guide to deploying the Pendo Launcher articles. The installation process described in this article doesn’t identify the visitors (end-users) or include metadata about them. Pair the installation with a follow-up configuration to identify visitors to Pendo.

For complete documentation on enterprise management of Firefox, see Mozilla’s article: Customizing Firefox Using policies.json.

Step 1. Create an installation script

The policies.json file you deliver is the same for both Windows and Mac devices. However, the script to deliver the file to its target location is different for each operating system.

In either script, if you want your end-users be able to uninstall the extension, then change the value force_installed to say normal_installed instead.

Mac devicesFor Mac devices, the following bash script creates the file in the default installation folder, /applications. If Firefox is installed in a different location on your end-users’ devices, change the value of dest_folder in this script.

#!/bin/bash 

# Destination folder path
dest_folder="/Applications/Firefox.app/Contents/Resources/distribution"

# JSON content
json_content='{
  "policies": {
    "EnterprisePoliciesEnabled": true,
    "ExtensionSettings": {
      "pendo-launcher@pendo.io": {
        "installation_mode": "force_installed",
        "install_url":
"https://addons.mozilla.org/firefox/downloads/latest/pendo-launcher/latest.xpi"
      }
    }
  }
}'

# Create the destination folder if it doesn't exist
if [ -d "/Applications/Firefox.app" ] && [ ! -d "$dest_folder" ]; then
   mkdir -p "$dest_folder"
   sudo chown $(whoami) "$dest_folder"
fi

# Save the JSON content to a file
if [ -d "$dest_folder" ];
then
   echo "$json_content" > "$dest_folder/policies.json"
fi

Windows devices

For Windows devices, use the following PowerShell script. If Firefox is installed in a different location on your end-users’ devices, adjust the value of dest_folder in this script.

$dest_folder = "C:\Program Files\Mozilla Firefox\distribution"
$json_content = '{
  "policies": {
    "EnterprisePoliciesEnabled": true,
    "ExtensionSettings": {
      "pendo-launcher@pendo.io": {
        "installation_mode": "force_installed",
        "install_url": "https://addons.mozilla.org/firefox/downloads/latest/pendo-launcher/latest.xpi"
      }
    }
  }
}'

if (!(Test-Path -Path $dest_folder)) {
    New-Item -ItemType Directory -Path $dest_folder | Out-Null
}

$json_content | Set-Content -Path "$dest_folder\policies.json"

Step 2. Push your script to end-user devices

Once you've created your script, run it on end-user devices using your MDM tooling. The specifics for running a shell script on end-user devices depends on your company’s MDM tooling. Below is a list of documentation for some of the most common MDM tools used for Mac and Windows devices:

Mac devices Windows devices

 

Step 3. Validate the installation

Pendo recommends gradual rollout of the installation, beginning with a device that you have physical access to. Once the policies profile is pushed to a given device, confirm its presence to validate your deployment process, and then confirm that the extension is installed to validate the content of your delivered profile.

Confirm the presence of the policies.json file

  1. Open the terminal on a device that has run the deployment script.
  2. Navigate to the target directory.
    • On a Mac, use cd /Applications/Firefox.app/Contents/Resources/distribution
    • On Windows, use cd C:\Program Files\Mozilla Firefox\distribution
  3. List the contents of the directory.
    • On a Mac, use ls -l
    • On Windows, use dir
  4. Search for the policies.json file to check that it's present.
  5. View the contents of the policies.json file.
    • On a Mac, use cat policies.json
    • On Windows, use more policies.json
  6. Check that the contents of the file match the policies.json file that you created in Step 1.

Validate the content of your delivered file

Once you've confirmed that the configuration file is present, validate that the file is formatted correctly by checking that the browser correctly force-installs the extension.

  1. Open Firefox on a device that has the policies file present. If the Firefox app is already running, quit and re-open it.
  2. In your Firefox browser, navigate to the about:policies page by copying and pasting that exact text into your URL bar. This displays the following policy:

    Active
  3. In your Firefox browser, navigate to the about:addons by copying and pasting that exact text into your URL bar.
  4. Find the Pendo Launcher, listed under Extensions. If you chose force_installed when creating the policies profile, there is no option to disable the extension from the page.

    PendoLauncherExtension.png