Table of Contents Previous entry (settings:content_script_api)
This document describes how to deploy Tampermonkey in a managed environment. It covers both installing the extension and centrally provisioning scripts and settings using managed browser policies.
The deployment approach is supported by:
The configuration itself is provided as a JSON export from a preconfigured Tampermonkey installation and fetched by managed Tampermonkey instances at startup. This requires version 5.5+ or 5.5.6235+ (BETA).
Deployment consists of three steps:
The provisioning file can include:
Tampermonkey provides a built-in export mechanism.
The resulting file (for example tm.json) is the provisioning source used by the browsers.
tm.json{
"version": "1",
"scripts": [
{
"name": "Log location",
"enabled": true,
"position": 1,
"uuid": "4190fc63-64c8-4c68-9a7c-96f41f85729a",
"source": "Ly8gPT1Vc2VyU2NyaXB0PT0KLy8gQG5[...]sb2cobG9jYXRpb24uaHJlZik7"
}
],
"settings": {
"configMode": 100,
"logLevel": 80
}
}
Host this file on an internal web server, for example:
php -S localhost:12121 -t .
In production mode – Use a real web server (Apache, Nginx, IIS, …) that serves the file over HTTPS with a valid certificate.
Each provisioning entry requires a content hash to guarantee integrity. If the hash does not match, Tampermonkey logs an error similar to:
Error: Hash mismatch for provisioning jsonImport from http://localhost:12121/tm.json:
expected 1:abcd... !== calculated 1:ef01...
The correct hash is shown in the error output (calculated …). Copy that value into the policy configuration.
A dedicated hash helper tool is planned.
Tampermonkey reads its managed configuration from the browser. Relevant schema excerpt:
{
"jsonImport": [
{
"hash": "1:…",
"url": "https://example.com/tm.json",
"haltOnError": true,
"installAsSystemScripts": false
}
]
}
See Q406 in the FAQ for Tampermonkey's extension IDs.
Firefox supports managed extension configuration via policies.json.
Policies can be inspected at:
about:policies/etc/firefox/policies/policies.json
{
"policies": {
"Extensions": {
"Install": [
"https://www.tampermonkey.net/xpi/firefox-current-beta.xpi"
]
},
"3rdparty": {
"Extensions": {
"firefoxbeta@tampermonkey.net": {
"jsonImport": [
{
"hash": "1:66849534c66c5bd384f39f7fb5c7c5bdbc8611bfedab082762cb943f853637d0",
"url": "http://localhost:12121/tm.json",
"haltOnError": true,
"installAsSystemScripts": false
}
]
}
}
}
}
}
Place policies.json in the distribution directory next to firefox.exe
Find the Firefox install directory (commonly):
C:\Program Files\Mozilla Firefox\
Create:
C:\Program Files\Mozilla Firefox\distribution\
Put this file here:
C:\Program Files\Mozilla Firefox\distribution\policies.json
Alternatively deploy via GPO or Intune
Place policies.json in the distribution directory
Find and edit:
Firefox.app/Contents/Resources/distribution/policies.json
Or deploy via configuration profiles / MDM
Mozilla policy documentation:
Policies can be inspected at:
chrome://policy/edge://policy//etc/opt/chrome/policies/managed/tampermonkey.json
{
"ExtensionInstallForcelist": [
"gcalenpjmijncebpfijmoaglllgpjagf"
],
"3rdparty": {
"extensions": {
"gcalenpjmijncebpfijmoaglllgpjagf": {
"jsonImport": [
{
"hash": "1:66849534c66c5bd384f39f7fb5c7c5bdbc8611bfedab082762cb943f853637d0",
"url": "http://localhost:12121/tm.json",
"haltOnError": true,
"installAsSystemScripts": false
}
]
}
}
}
}
Create a .reg file (e.g. tampermonkey_provision.reg) and import it with reg import as an administrator:
Windows Registry Editor Version 5.00
; Force‑install Tampermonkey (if not already installed)
[HKEY_LOCAL_MACHINE\Software\Policies\Google\Chrome\ExtensionInstallForcelist]
"1"="gcalenpjmijncebpfijmoaglllgpjagf"
; 3rd‑party policy for the extension
[HKEY_LOCAL_MACHINE\Software\Policies\Google\Chrome\3rdparty\extensions\gcalenpjmijncebpfijmoaglllgpjagf\jsonImport\1]
"hash"="1:66849534c66c5bd384f39f7fb5c7c5bdbc8611bfedab082762cb943f853637d0"
"url"="http://localhost:12121/tm.json"
"haltOnError"=dword:00000001
"installAsSystemScripts"=dword:00000000
.mobileconfig or .plistChromium documentation: