Skip to content

Instantly share code, notes, and snippets.

@vttc08
Last active August 23, 2024 05:45
Show Gist options
  • Save vttc08/4b2dbf55157a61bb2f92de01c566bc19 to your computer and use it in GitHub Desktop.
Save vttc08/4b2dbf55157a61bb2f92de01c566bc19 to your computer and use it in GitHub Desktop.
Firefox Basic policies.json For First Time Setup
{
"policies": {
"ExtensionSettings": {
"[email protected]": {
"installation_mode": "force_installed",
"install_url": "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi"
}
},
"NoDefaultBookmarks": true,
"DontCheckDefaultBrowser": true,
"DisableTelemetry": true,
"FirefoxHome": {
"Search": true,
"TopSites": true,
"SponsoredTopSites": false,
"Pocket": false,
"SponsoredPocket": false,
"Locked": false
}
}
}

Firefox can use policies.json to customize it. This is especially useful for first-time setup where it can be tedious to go manually disable sponsored portions and install Ublock Origin.

This policy force the installation of Ublock Origin where it cannot be disabled (although uBO cannot be uninstalled, this does not prevent use from whitelisting sites; and it does not support adding custom filters). It also setup the homepage correctly, disable Pocket, sponsored stories and telemetry. To use this, place the policies.json file into the correct location. Windows

C:\Program Files\Mozilla Firefox\distribution\

Linux (system-wide)

/etc/firefox/policies

Verify it's working, launch Firefox and go to

about:policies
  • if it's working, it should give you the list of policies
  • if it says enterprise policies not active or other errors, it's either the json file is not in the correct location or json formatting is wrong
    • make sure the encoding type of the json file is in UTF-8

Bonus: run a docker container of temporary firefox WebUI that can be destroyed but still have the nessecary setup for web browsing

docker run -d --rm --name firefox-temp -v ./policies.json:/etc/firefox/policies/policies.json -p 5801:5800 -e WEB_AUDIO=1 -e DARK_MODE=1 jlesage/firefox
  • run a ephemeral firefox container from jlesage, when it's stopped, it's removed and the same command can be used to run it as many times you want
  • make sure the policies.json file exist in current path
  • customize port and dark theme to your liking
  • once the container is stopped or restarted, every browsing history/data/passwords will be gone; except for uBlock and ad-free related firefox configurations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment