Set firefox arkenfox preferences in template revisions

Go back to topic: Set firefox arkenfox preferences in template

  1. v6 anchor; v6 full version
  2. v5 anchor; v5 full version
  3. v4 anchor; v4 full version
  4. v3 anchor; v3 full version
  5. v2 anchor; v2 full version

Revision #6

Edited on
2026-01-25
Edited by user
dkzkz
``` ``` Paste this content inside the file ``` { "policies": { "Extensions": { "Install": [ "https://addons.mozilla.org/firefox/downloads/file/4629131/ublock_origin-1.68.0.xpi" ], "Locked": [ "ublockorigin@raymondhill.net" ] } } } ```
I edited the post because i realize that using the arkenfox pref inside policies.json was a bad idea because some telemetry was still enable even with the pref value from arkenfox. By looking at the mozilla doc i see we could use autoconfig instead to do this. By the way i have a error saying "New user can only use 2 links in a post" so i removed some link in the post.I edited the post because i realize that using the arkenfox pref inside policies.json was a bad idea because some telemetry was still enable even with the pref value from arkenfox. By looking at the mozilla doc i see we could use autoconfig instead to do this. By the way i have a error saying "New user can only use 2 links in a post" so i removed some link in the post. Edit : I forget to give the content of /etc/firefox/policies/policies.json i updated the post

Revision #5

Edited on
2026-01-25
Edited by user
dkzkz

Revision #4

Edited on
2026-01-24
Edited by user
dkzkz
Before running the script do : ``` nano input.txt ``` inside "input.txt" copy and paste the whole content of the user.js from arkenfox by doing CTRL+A
python3 p.py input.txt python3 p.py user.js

Revision #3

Edited on
2026-01-24
Edited by user
dkzkz
3. > sudo nano /etc/firefox/policies/policies.json > { > "policies": { > "Extensions": { > "Install": [ > "https://addons.mozilla.org/firefox/downloads/file/4629131/ublock_origin-1.68.0.xpi" > ], > "Locked": [ > "ublockorigin@raymondhill.net" > ] > } > } > } 3. Copy and paste every commands ``` sudo nano /etc/firefox/policies/policies.json ```
4. Do > sudo nano /usr/lib/firefox/defaults/pref/autoconfig.js and put this inside : > pref("general.config.filename", "firefox.cfg"); > pref("general.config.obscure_value", 0); 5. Do > sudo nano /usr/lib/firefox/defaults/firefox.cfg 4. Do ``` sudo nano /usr/lib/firefox/defaults/pref/autoconfig.js ``` and put this inside : ``` pref("general.config.filename", "firefox.cfg"); pref("general.config.obscure_value", 0); ``` 5. Do ``` sudo nano /usr/lib/firefox/defaults/firefox.cfg` ```
> // IMPORTANT: Start your code on the 2nd line > pref("_user.js.parrot", "START: Oh yes, the Norwegian Blue... what's wrong with it?"); > pref("browser.aboutConfig.showWarning", false); > pref("_user.js.parrot", "0100 syntax error: the parrot's dead!"); > pref("browser.startup.page", 0); > pref("browser.startup.homepage", "chrome://browser/content/blanktab.html"); > pref("browser.newtabpage.enabled", false); > pref("browser.newtabpage.activity-stream.showSponsored", false); > pref("browser.newtabpage.activity-stream.showSponsoredTopSites", false); > pref("browser.newtabpage.activity-stream.showSponsoredCheckboxes", false); > pref("browser.newtabpage.activity-stream.default.sites", ""); > pref("_user.js.parrot", "0200 syntax error: the parrot's definitely deceased!"); > pref("geo.provider.ms-windows-location", false); > pref("geo.provider.use_corelocation", false); > pref("geo.provider.use_geoclue", false); > pref("_user.js.parrot", "0300 syntax error: the parrot's not pinin' for the fjords!"); > pref("extensions.getAddons.showPane", false); > pref("extensions.htmlaboutaddons.recommendations.enabled", false); > pref("browser.discovery.enabled", false); > pref("browser.newtabpage.activity-stream.feeds.telemetry", false); > pref("browser.newtabpage.activity-stream.telemetry", false); > pref("app.shield.optoutstudies.enabled", false); > pref("app.normandy.enabled", false); > pref("app.normandy.api_url", ""); > pref("breakpad.reportURL", ""); > pref("browser.tabs.crashReporting.sendReport", false); > pref("browser.crashReports.unsubmittedCheck.autoSubmit2", false); > pref("captivedetect.canonicalURL", ""); > pref("network.captive-portal-service.enabled", false); > pref("network.connectivity-service.enabled", false); > pref("_user.js.parrot", "0400 syntax error: the parrot's passed on!"); > pref("browser.safebrowsing.downloads.remote.enabled", false); > pref("_user.js.parrot", "0600 syntax error: the parrot's no more!"); > pref("network.prefetch-next", false); > pref("network.dns.disablePrefetch", true); > pref("network.dns.disablePrefetchFromHTTPS", true); > pref("network.predictor.enabled", false); > pref("network.predictor.enable-prefetch", false); > pref("network.http.speculative-parallel-limit", 0); > pref("browser.places.speculativeConnect.enabled", false); > pref("_user.js.parrot", "0700 syntax error: the parrot's given up the ghost!"); > pref("network.proxy.socks_remote_dns", true); > pref("network.file.disable_unc_paths", true); > pref("network.gio.supported-protocols", ""); > pref("_user.js.parrot", "0800 syntax error: the parrot's ceased to be!"); > pref("browser.urlbar.speculativeConnect.enabled", false); > pref("browser.urlbar.quicksuggest.enabled", false); > pref("browser.urlbar.suggest.quicksuggest.nonsponsored", false); > pref("browser.urlbar.suggest.quicksuggest.sponsored", false); > pref("browser.search.suggest.enabled", false); > pref("browser.urlbar.suggest.searches", false); > pref("browser.urlbar.trending.featureGate", false); > pref("browser.urlbar.addons.featureGate", false); > pref("browser.urlbar.amp.featureGate", false); > pref("browser.urlbar.fakespot.featureGate", false); > pref("browser.urlbar.mdn.featureGate", false); > pref("browser.urlbar.weather.featureGate", false); > pref("browser.urlbar.wikipedia.featureGate", false); > pref("browser.urlbar.yelp.featureGate", false); > pref("browser.formfill.enable", false); > pref("browser.search.separatePrivateDefault", true); > pref("browser.search.separatePrivateDefault.ui.enabled", true); > pref("_user.js.parrot", "0900 syntax error: the parrot's expired!"); > pref("signon.autofillForms", false); > pref("signon.formlessCapture.enabled", false); > pref("network.auth.subresource-http-auth-allow", 1); > pref("_user.js.parrot", "1000 syntax error: the parrot's gone to meet 'is maker!"); > pref("browser.cache.disk.enable", false); > pref("browser.privatebrowsing.forceMediaMemoryCache", true); > pref("media.memory_cache_max_size", 65536); > pref("browser.sessionstore.privacy_level", 2); > pref("toolkit.winRegisterApplicationRestart", false); > pref("browser.shell.shortcutFavicons", false); > pref("_user.js.parrot", "1200 syntax error: the parrot's a stiff!"); > pref("security.ssl.require_safe_negotiation", true); > pref("security.tls.enable_0rtt_data", false); > pref("security.OCSP.enabled", 1); > pref("security.OCSP.require", true); > pref("security.cert_pinning.enforcement_level", 2); > pref("security.remote_settings.crlite_filters.enabled", true); > pref("security.pki.crlite_mode", 2); > pref("dom.security.https_only_mode", true); > pref("dom.security.https_only_mode_send_http_background_request", false); > pref("security.ssl.treat_unsafe_negotiation_as_broken", true); > pref("browser.xul.error_pages.expert_bad_cert", true); > pref("_user.js.parrot", "1600 syntax error: the parrot rests in peace!"); > pref("network.http.referer.XOriginTrimmingPolicy", 2); > pref("_user.js.parrot", "1700 syntax error: the parrot's bit the dust!"); > pref("privacy.userContext.enabled", true); > pref("privacy.userContext.ui.enabled", true); > pref("_user.js.parrot", "2000 syntax error: the parrot's snuffed it!"); > pref("media.peerconnection.ice.proxy_only_if_behind_proxy", true); > pref("media.peerconnection.ice.default_address_only", true); > pref("_user.js.parrot", "2400 syntax error: the parrot's kicked the bucket!"); > pref("dom.disable_window_move_resize", true); > pref("_user.js.parrot", "2600 syntax error: the parrot's run down the curtain!"); > pref("browser.download.start_downloads_in_tmp_dir", true); > pref("browser.helperApps.deleteTempFileOnExit", true); > pref("browser.uitour.enabled", false); > pref("devtools.debugger.remote-enabled", false); > pref("permissions.manager.defaultsUrl", ""); > pref("network.IDN_show_punycode", true); > pref("pdfjs.disabled", false); > pref("pdfjs.enableScripting", false); > pref("browser.tabs.searchclipboardfor.middleclick", false); > pref("browser.contentanalysis.enabled", false); > pref("browser.contentanalysis.default_result", 0); > pref("security.csp.reporting.enabled", false); > pref("browser.download.useDownloadDir", false); > pref("browser.download.alwaysOpenPanel", false); > pref("browser.download.manager.addToRecentDocs", false); > pref("browser.download.always_ask_before_handling_new_types", true); > pref("extensions.enabledScopes", 5); > pref("extensions.postDownloadThirdPartyPrompt", false); > pref("_user.js.parrot", "2700 syntax error: the parrot's joined the bleedin' choir invisible!"); > pref("browser.contentblocking.category", "strict"); > pref("_user.js.parrot", "2800 syntax error: the parrot's bleedin' demised!"); > pref("privacy.sanitize.sanitizeOnShutdown", true); > pref("privacy.clearOnShutdown_v2.cache", true); > pref("privacy.clearOnShutdown_v2.historyFormDataAndDownloads", false); > pref("privacy.clearOnShutdown_v2.browsingHistoryAndDownloads", false); > pref("privacy.clearOnShutdown_v2.downloads", false); > pref("privacy.clearOnShutdown_v2.formdata", true); > pref("privacy.clearOnShutdown_v2.cookiesAndStorage", true); > pref("privacy.clearSiteData.cache", true); > pref("privacy.clearSiteData.cookiesAndStorage", false); > pref("privacy.clearSiteData.historyFormDataAndDownloads", false); > pref("privacy.clearSiteData.browsingHistoryAndDownloads", false); > pref("privacy.clearSiteData.formdata", true); > pref("privacy.clearHistory.cache", true); > pref("privacy.clearHistory.cookiesAndStorage", false); > pref("privacy.clearHistory.historyFormDataAndDownloads", false); > pref("privacy.clearHistory.browsingHistoryAndDownloads", false); > pref("privacy.clearHistory.formdata", true); > pref("privacy.sanitize.timeSpan", 0); > pref("_user.js.parrot", "4000 syntax error: the parrot's bereft of life!"); > pref("_user.js.parrot", "4500 syntax error: the parrot's popped 'is clogs"); > pref("privacy.window.maxInnerWidth", 1600); > pref("privacy.window.maxInnerHeight", 900); > pref("privacy.resistFingerprinting.block_mozAddonManager", true); > pref("privacy.spoof_english", 1); > pref("widget.non-native-theme.use-theme-accent", false); > pref("browser.link.open_newwindow", 3); > pref("browser.link.open_newwindow.restriction", 0); > pref("_user.js.parrot", "5000 syntax error: the parrot's taken 'is last bow"); > pref("_user.js.parrot", "5500 syntax error: this is an ex-parrot!"); > pref("_user.js.parrot", "6000 syntax error: the parrot's 'istory!"); > pref("extensions.blocklist.enabled", true); > pref("network.http.referer.spoofSource", false); > pref("security.dialog_enable_delay", 1000); > pref("privacy.firstparty.isolate", false); > pref("extensions.webcompat.enable_shims", true); > pref("security.tls.version.enable-deprecated", false); > pref("extensions.webcompat-reporter.enabled", false); > pref("extensions.quarantinedDomains.enabled", true); > pref("_user.js.parrot", "7000 syntax error: the parrot's pushing up daisies!"); > pref("_user.js.parrot", "8000 syntax error: the parrot's crossed the Jordan"); > pref("_user.js.parrot", "8500 syntax error: the parrot's off the twig!"); > pref("datareporting.policy.dataSubmissionEnabled", false); > pref("datareporting.healthreport.uploadEnabled", false); > pref("toolkit.telemetry.unified", false); > pref("toolkit.telemetry.enabled", false); > pref("toolkit.telemetry.server", "data:,"); > pref("toolkit.telemetry.archive.enabled", false); > pref("toolkit.telemetry.newProfilePing.enabled", false); > pref("toolkit.telemetry.shutdownPingSender.enabled", false); > pref("toolkit.telemetry.updatePing.enabled", false); > pref("toolkit.telemetry.bhrPing.enabled", false); > pref("toolkit.telemetry.firstShutdownPing.enabled", false); > pref("toolkit.telemetry.coverage.opt-out", true); > pref("toolkit.coverage.opt-out", true); > pref("toolkit.coverage.endpoint.base", ""); > pref("_user.js.parrot", "9000 syntax error: the parrot's cashed in 'is chips!"); > pref("browser.startup.homepage_override.mstone", "ignore"); > pref("browser.newtabpage.activity-stream.asrouter.userprefs.cfr.addons", false); > pref("browser.newtabpage.activity-stream.asrouter.userprefs.cfr.features", false); > pref("browser.urlbar.showSearchTerms.enabled", false); > pref("_user.js.parrot", "9999 syntax error: the parrot's shuffled off 'is mortal coil!"); > pref("browser.shopping.experience2023.enabled", false); > pref("browser.urlbar.pocket.featureGate", false); > pref("_user.js.parrot", "SUCCESS: No no he's not dead, he's, he's restin'!"); ``` // IMPORTANT: Start your code on the 2nd line pref("_user.js.parrot", "START: Oh yes, the Norwegian Blue... what's wrong with it?"); pref("browser.aboutConfig.showWarning", false); pref("_user.js.parrot", "0100 syntax error: the parrot's dead!"); pref("browser.startup.page", 0); pref("browser.startup.homepage", "chrome://browser/content/blanktab.html"); pref("browser.newtabpage.enabled", false); pref("browser.newtabpage.activity-stream.showSponsored", false); pref("browser.newtabpage.activity-stream.showSponsoredTopSites", false); pref("browser.newtabpage.activity-stream.showSponsoredCheckboxes", false); pref("browser.newtabpage.activity-stream.default.sites", ""); pref("_user.js.parrot", "0200 syntax error: the parrot's definitely deceased!"); pref("geo.provider.ms-windows-location", false); pref("geo.provider.use_corelocation", false); pref("geo.provider.use_geoclue", false); pref("_user.js.parrot", "0300 syntax error: the parrot's not pinin' for the fjords!"); pref("extensions.getAddons.showPane", false); pref("extensions.htmlaboutaddons.recommendations.enabled", false); pref("browser.discovery.enabled", false); pref("browser.newtabpage.activity-stream.feeds.telemetry", false); pref("browser.newtabpage.activity-stream.telemetry", false); pref("app.shield.optoutstudies.enabled", false); pref("app.normandy.enabled", false); pref("app.normandy.api_url", ""); pref("breakpad.reportURL", ""); pref("browser.tabs.crashReporting.sendReport", false); pref("browser.crashReports.unsubmittedCheck.autoSubmit2", false); pref("captivedetect.canonicalURL", ""); pref("network.captive-portal-service.enabled", false); pref("network.connectivity-service.enabled", false); pref("_user.js.parrot", "0400 syntax error: the parrot's passed on!"); pref("browser.safebrowsing.downloads.remote.enabled", false); pref("_user.js.parrot", "0600 syntax error: the parrot's no more!"); pref("network.prefetch-next", false); pref("network.dns.disablePrefetch", true); pref("network.dns.disablePrefetchFromHTTPS", true); pref("network.predictor.enabled", false); pref("network.predictor.enable-prefetch", false); pref("network.http.speculative-parallel-limit", 0); pref("browser.places.speculativeConnect.enabled", false); pref("_user.js.parrot", "0700 syntax error: the parrot's given up the ghost!"); pref("network.proxy.socks_remote_dns", true); pref("network.file.disable_unc_paths", true); pref("network.gio.supported-protocols", ""); pref("_user.js.parrot", "0800 syntax error: the parrot's ceased to be!"); pref("browser.urlbar.speculativeConnect.enabled", false); pref("browser.urlbar.quicksuggest.enabled", false); pref("browser.urlbar.suggest.quicksuggest.nonsponsored", false); pref("browser.urlbar.suggest.quicksuggest.sponsored", false); pref("browser.search.suggest.enabled", false); pref("browser.urlbar.suggest.searches", false); pref("browser.urlbar.trending.featureGate", false); pref("browser.urlbar.addons.featureGate", false); pref("browser.urlbar.amp.featureGate", false); pref("browser.urlbar.fakespot.featureGate", false); pref("browser.urlbar.mdn.featureGate", false); pref("browser.urlbar.weather.featureGate", false); pref("browser.urlbar.wikipedia.featureGate", false); pref("browser.urlbar.yelp.featureGate", false); pref("browser.formfill.enable", false); pref("browser.search.separatePrivateDefault", true); pref("browser.search.separatePrivateDefault.ui.enabled", true); pref("_user.js.parrot", "0900 syntax error: the parrot's expired!"); pref("signon.autofillForms", false); pref("signon.formlessCapture.enabled", false); pref("network.auth.subresource-http-auth-allow", 1); pref("_user.js.parrot", "1000 syntax error: the parrot's gone to meet 'is maker!"); pref("browser.cache.disk.enable", false); pref("browser.privatebrowsing.forceMediaMemoryCache", true); pref("media.memory_cache_max_size", 65536); pref("browser.sessionstore.privacy_level", 2); pref("toolkit.winRegisterApplicationRestart", false); pref("browser.shell.shortcutFavicons", false); pref("_user.js.parrot", "1200 syntax error: the parrot's a stiff!"); pref("security.ssl.require_safe_negotiation", true); pref("security.tls.enable_0rtt_data", false); pref("security.OCSP.enabled", 1); pref("security.OCSP.require", true); pref("security.cert_pinning.enforcement_level", 2); pref("security.remote_settings.crlite_filters.enabled", true); pref("security.pki.crlite_mode", 2); pref("dom.security.https_only_mode", true); pref("dom.security.https_only_mode_send_http_background_request", false); pref("security.ssl.treat_unsafe_negotiation_as_broken", true); pref("browser.xul.error_pages.expert_bad_cert", true); pref("_user.js.parrot", "1600 syntax error: the parrot rests in peace!"); pref("network.http.referer.XOriginTrimmingPolicy", 2); pref("_user.js.parrot", "1700 syntax error: the parrot's bit the dust!"); pref("privacy.userContext.enabled", true); pref("privacy.userContext.ui.enabled", true); pref("_user.js.parrot", "2000 syntax error: the parrot's snuffed it!"); pref("media.peerconnection.ice.proxy_only_if_behind_proxy", true); pref("media.peerconnection.ice.default_address_only", true); pref("_user.js.parrot", "2400 syntax error: the parrot's kicked the bucket!"); pref("dom.disable_window_move_resize", true); pref("_user.js.parrot", "2600 syntax error: the parrot's run down the curtain!"); pref("browser.download.start_downloads_in_tmp_dir", true); pref("browser.helperApps.deleteTempFileOnExit", true); pref("browser.uitour.enabled", false); pref("devtools.debugger.remote-enabled", false); pref("permissions.manager.defaultsUrl", ""); pref("network.IDN_show_punycode", true); pref("pdfjs.disabled", false); pref("pdfjs.enableScripting", false); pref("browser.tabs.searchclipboardfor.middleclick", false); pref("browser.contentanalysis.enabled", false); pref("browser.contentanalysis.default_result", 0); pref("security.csp.reporting.enabled", false); pref("browser.download.useDownloadDir", false); pref("browser.download.alwaysOpenPanel", false); pref("browser.download.manager.addToRecentDocs", false); pref("browser.download.always_ask_before_handling_new_types", true); pref("extensions.enabledScopes", 5); pref("extensions.postDownloadThirdPartyPrompt", false); pref("_user.js.parrot", "2700 syntax error: the parrot's joined the bleedin' choir invisible!"); pref("browser.contentblocking.category", "strict"); pref("_user.js.parrot", "2800 syntax error: the parrot's bleedin' demised!"); pref("privacy.sanitize.sanitizeOnShutdown", true); pref("privacy.clearOnShutdown_v2.cache", true); pref("privacy.clearOnShutdown_v2.historyFormDataAndDownloads", false); pref("privacy.clearOnShutdown_v2.browsingHistoryAndDownloads", false); pref("privacy.clearOnShutdown_v2.downloads", false); pref("privacy.clearOnShutdown_v2.formdata", true); pref("privacy.clearOnShutdown_v2.cookiesAndStorage", true); pref("privacy.clearSiteData.cache", true); pref("privacy.clearSiteData.cookiesAndStorage", false); pref("privacy.clearSiteData.historyFormDataAndDownloads", false); pref("privacy.clearSiteData.browsingHistoryAndDownloads", false); pref("privacy.clearSiteData.formdata", true); pref("privacy.clearHistory.cache", true); pref("privacy.clearHistory.cookiesAndStorage", false); pref("privacy.clearHistory.historyFormDataAndDownloads", false); pref("privacy.clearHistory.browsingHistoryAndDownloads", false); pref("privacy.clearHistory.formdata", true); pref("privacy.sanitize.timeSpan", 0); pref("_user.js.parrot", "4000 syntax error: the parrot's bereft of life!"); pref("_user.js.parrot", "4500 syntax error: the parrot's popped 'is clogs"); pref("privacy.window.maxInnerWidth", 1600); pref("privacy.window.maxInnerHeight", 900); pref("privacy.resistFingerprinting.block_mozAddonManager", true); pref("privacy.spoof_english", 1); pref("widget.non-native-theme.use-theme-accent", false); pref("browser.link.open_newwindow", 3); pref("browser.link.open_newwindow.restriction", 0); pref("_user.js.parrot", "5000 syntax error: the parrot's taken 'is last bow"); pref("_user.js.parrot", "5500 syntax error: this is an ex-parrot!"); pref("_user.js.parrot", "6000 syntax error: the parrot's 'istory!"); pref("extensions.blocklist.enabled", true); pref("network.http.referer.spoofSource", false); pref("security.dialog_enable_delay", 1000); pref("privacy.firstparty.isolate", false); pref("extensions.webcompat.enable_shims", true); pref("security.tls.version.enable-deprecated", false); pref("extensions.webcompat-reporter.enabled", false); pref("extensions.quarantinedDomains.enabled", true); pref("_user.js.parrot", "7000 syntax error: the parrot's pushing up daisies!"); pref("_user.js.parrot", "8000 syntax error: the parrot's crossed the Jordan"); pref("_user.js.parrot", "8500 syntax error: the parrot's off the twig!"); pref("datareporting.policy.dataSubmissionEnabled", false); pref("datareporting.healthreport.uploadEnabled", false); pref("toolkit.telemetry.unified", false); pref("toolkit.telemetry.enabled", false); pref("toolkit.telemetry.server", "data:,"); pref("toolkit.telemetry.archive.enabled", false); pref("toolkit.telemetry.newProfilePing.enabled", false); pref("toolkit.telemetry.shutdownPingSender.enabled", false); pref("toolkit.telemetry.updatePing.enabled", false); pref("toolkit.telemetry.bhrPing.enabled", false); pref("toolkit.telemetry.firstShutdownPing.enabled", false); pref("toolkit.telemetry.coverage.opt-out", true); pref("toolkit.coverage.opt-out", true); pref("toolkit.coverage.endpoint.base", ""); pref("_user.js.parrot", "9000 syntax error: the parrot's cashed in 'is chips!"); pref("browser.startup.homepage_override.mstone", "ignore"); pref("browser.newtabpage.activity-stream.asrouter.userprefs.cfr.addons", false); pref("browser.newtabpage.activity-stream.asrouter.userprefs.cfr.features", false); pref("browser.urlbar.showSearchTerms.enabled", false); pref("_user.js.parrot", "9999 syntax error: the parrot's shuffled off 'is mortal coil!"); pref("browser.shopping.experience2023.enabled", false); pref("browser.urlbar.pocket.featureGate", false); pref("_user.js.parrot", "SUCCESS: No no he's not dead, he's, he's restin'!"); ```
> #!/usr/bin/env python3 > """ > Convert lines like: > user_pref("privacy.clearOnShutdown_v2.cookiesAndStorage", true); > to an autoconfig firefox.cfg containing pref(...) lines. > > Usage: > python3 convert_userjs_to_autoconfig.py [input_file] > If no input_file given, reads stdin. > """ > > import sys > import re > from pathlib import Path > > USER_PREF_RE = re.compile( > r'^\s*(?P<prefix>//\s*)?user_pref\(\s*"(?P<name>[^"]+)"\s*,\s*(?P<value>.+?)\s*\)\s*;\s*(?://.*)?$' > ) > > def normalize_value(val_str): > v = val_str.strip() > # Keep strings quoted, booleans and numbers unquoted, arrays/objects unchanged > if (v.startswith('"') and v.endswith('"')) or (v.startswith("'") and v.endswith("'")): > return v > if v.lower() in ("true", "false"): > return v.lower() > # Try numeric > try: > float(v) > return v > except Exception: > pass > # Fallback: ensure it's a JS string > escaped = v.replace('"', '\\"') > return f'"{escaped}"' > > def process_lines(lines): > out_lines = [] > for ln in lines: > m = USER_PREF_RE.match(ln) > if not m: > continue > # If the line is commented (prefix captured) skip > if m.group('prefix'): > continue > name = m.group('name') > raw_value = m.group('value') > # If the value itself is commented out (e.g. // at start) skip > if raw_value.strip().startswith("//"): > continue > value = normalize_value(raw_value) > out_lines.append(f'pref("{name}", {value});') > return out_lines > > def main(): > # Read input > if len(sys.argv) > 1: > p = Path(sys.argv[1]) > if not p.exists(): > print(f"Input file not found: {p}", file=sys.stderr) > sys.exit(2) > src = p.read_text(encoding='utf-8').splitlines() > else: > src = sys.stdin.read().splitlines() > > prefs = process_lines(src) > > if not prefs: > print("No user_pref(...) lines found.", file=sys.stderr) > sys.exit(1) > > out_path = Path("firefox.cfg") > header = "// IMPORTANT: Start your code on the 2nd line\n" > content = header + "\n".join(prefs) + "\n" > out_path.write_text(content, encoding='utf-8', newline="\n") > print(f"Wrote {len(prefs)} prefs to {out_path}") > > if __name__ == "__main__": > main() ``` #!/usr/bin/env python3 """ Convert lines like: user_pref("privacy.clearOnShutdown_v2.cookiesAndStorage", true); to an autoconfig firefox.cfg containing pref(...) lines. Usage: python3 .py [input_file] If no input_file given, reads stdin. """ import sys import re from pathlib import Path USER_PREF_RE = re.compile( r'^\s*(?P<prefix>//\s*)?user_pref\(\s*"(?P<name>[^"]+)"\s*,\s*(?P<value>.+?)\s*\)\s*;\s*(?://.*)?$' ) def normalize_value(val_str): v = val_str.strip() # Keep strings quoted, booleans and numbers unquoted, arrays/objects unchanged if (v.startswith('"') and v.endswith('"')) or (v.startswith("'") and v.endswith("'")): return v if v.lower() in ("true", "false"): return v.lower() # Try numeric try: float(v) return v except Exception: pass # Fallback: ensure it's a JS string escaped = v.replace('"', '\\"') return f'"{escaped}"' def process_lines(lines): out_lines = [] for ln in lines: m = USER_PREF_RE.match(ln) if not m: continue # If the line is commented (prefix captured) skip if m.group('prefix'): continue name = m.group('name') raw_value = m.group('value') # If the value itself is commented out (e.g. // at start) skip if raw_value.strip().startswith("//"): continue value = normalize_value(raw_value) out_lines.append(f'pref("{name}", {value});') return out_lines def main(): # Read input if len(sys.argv) > 1: p = Path(sys.argv[1]) if not p.exists(): print(f"Input file not found: {p}", file=sys.stderr) sys.exit(2) src = p.read_text(encoding='utf-8').splitlines() else: src = sys.stdin.read().splitlines() prefs = process_lines(src) if not prefs: print("No user_pref(...) lines found.", file=sys.stderr) sys.exit(1) out_path = Path("firefox.cfg") header = "// IMPORTANT: Start your code on the 2nd line\n" content = header + "\n".join(prefs) + "\n" out_path.write_text(content, encoding='utf-8', newline="\n") print(f"Wrote {len(prefs)} prefs to {out_path}") if __name__ == "__main__": main() ```
Before running the script do : > nano input.txt inside "input.txt" copy and paste the whole content of the user.js from arkenfox Before running the script do : ``` nano input.txt ``` inside "input.txt" copy and paste the whole content of the user.js from arkenfox by doing CTRL+A
> python3 p.py input.txt ``` python3 p.py input.txt ```
> sudo mv firefox.cfg /usr/lib/firefox/ ``` sudo mv firefox.cfg /usr/lib/firefox/ ```

Revision #2

Edited on
2026-01-24
Edited by user
dkzkz
So the idea of this post is to do the same thing described [here](https://forum.qubes-os.org/t/set-custom-preferences-for-brave-browser-in-disposable-qube/27351) We will use the last js value from [arkenfox](https://github.com/arkenfox/user.js) and this will automatically install ublock origin at launch (like librewolf) 1. Install firefox 2. Delete your firefox profile if you have one (i think deleting the AppVM then re-create it might be better just in case) 3. nano /etc/firefox/policies/policies.json ``` { "policies": { "Extensions": { "Install": [ "https://addons.mozilla.org/firefox/downloads/file/4629131/ublock_origin-1.68.0.xpi" ], "Locked": [ "ublockorigin@raymondhill.net" ] }, "Preferences": { "browser.startup.page": 0, "browser.startup.homepage": "chrome://browser/content/blanktab.html", "browser.newtabpage.enabled": false, "browser.newtabpage.activity-stream.showSponsored": false, "browser.newtabpage.activity-stream.telemetry.privatePing.enabled": false, "browser.newtabpage.activity-stream.telemetry.privatePing.redactNewtabPing.enabled": false, "browser.newtabpage.activity-stream.showSponsoredTopSites": false, "browser.newtabpage.activity-stream.showSponsoredCheckboxes": false, "browser.newtabpage.activity-stream.default.sites": "", "geo.provider.use_geoclue": false, "extensions.getAddons.showPane": false, "extensions.htmlaboutaddons.recommendations.enabled": false, "browser.discovery.enabled": false, "browser.newtabpage.activity-stream.feeds.telemetry": false, "browser.newtabpage.activity-stream.telemetry": false, "app.shield.optoutstudies.enabled": false, "app.normandy.enabled": false, "app.normandy.api_url": "", "breakpad.reportURL": "", "browser.tabs.crashReporting.sendReport": false, "browser.crashReports.unsubmittedCheck.autoSubmit2": false, "captivedetect.canonicalURL": "", "network.captive-portal-service.enabled": false, "browser.safebrowsing.downloads.remote.enabled": false, "network.prefetch-next": false, "network.dns.disablePrefetch": true, "network.dns.disablePrefetchFromHTTPS": true, "network.predictor.enabled": false, "network.predictor.enable-prefetch": false, "network.http.speculative-parallel-limit": 0, "browser.places.speculativeConnect.enabled": false, "network.proxy.socks_remote_dns": true, "network.file.disable_unc_paths": true, "network.gio.supported-protocols": "", "browser.urlbar.speculativeConnect.enabled": false, "browser.urlbar.quicksuggest.enabled": false, "browser.urlbar.suggest.quicksuggest.nonsponsored": false, "browser.urlbar.suggest.quicksuggest.sponsored": false, "browser.search.suggest.enabled": false, "browser.urlbar.suggest.searches": false, "browser.urlbar.trending.featureGate": false, "browser.urlbar.addons.featureGate": false, "browser.urlbar.amp.featureGate": false, "browser.urlbar.fakespot.featureGate": false, "browser.urlbar.mdn.featureGate": false, "browser.urlbar.weather.featureGate": false, "browser.urlbar.wikipedia.featureGate": false, "browser.urlbar.yelp.featureGate": false, "browser.formfill.enable": false, "browser.search.separatePrivateDefault": true, "browser.search.separatePrivateDefault.ui.enabled": true, "signon.autofillForms": false, "signon.formlessCapture.enabled": false, "network.auth.subresource-http-auth-allow": 1, "browser.cache.disk.enable": false, "browser.privatebrowsing.forceMediaMemoryCache": true, "media.memory_cache_max_size": 65536, "browser.sessionstore.privacy_level": 2, "toolkit.winRegisterApplicationRestart": false, "browser.shell.shortcutFavicons": false, "security.ssl.require_safe_negotiation": true, "security.tls.enable_0rtt_data": false, "security.OCSP.enabled": 1, "security.OCSP.require": true, "security.cert_pinning.enforcement_level": 2, "security.remote_settings.crlite_filters.enabled": true, "security.pki.crlite_mode": 2, "dom.security.https_only_mode": true, "dom.security.https_only_mode_send_http_background_request": false, "security.ssl.treat_unsafe_negotiation_as_broken": true, "browser.xul.error_pages.expert_bad_cert": true, "network.http.referer.XOriginTrimmingPolicy": 2, "privacy.userContext.enabled": true, "privacy.userContext.ui.enabled": true, "media.peerconnection.ice.proxy_only_if_behind_proxy": true, "media.peerconnection.ice.default_address_only": true, "dom.disable_window_move_resize": true, "browser.download.start_downloads_in_tmp_dir": true, "browser.helperApps.deleteTempFileOnExit": true, "browser.uitour.enabled": false, "devtools.debugger.remote-enabled": false, "permissions.manager.defaultsUrl": "", "network.IDN_show_punycode": true, "pdfjs.disabled": false, "pdfjs.enableScripting": false, "browser.tabs.searchclipboardfor.middleclick": false, "browser.contentanalysis.enabled": false, "browser.contentanalysis.default_result": 0, "security.csp.reporting.enabled": false, "browser.download.useDownloadDir": false, "browser.download.alwaysOpenPanel": false, "browser.download.manager.addToRecentDocs": false, "browser.download.always_ask_before_handling_new_types": true, "extensions.enabledScopes": 5, "extensions.postDownloadThirdPartyPrompt": false, "browser.contentblocking.category": "strict", "privacy.sanitize.sanitizeOnShutdown": true, "privacy.clearOnShutdown_v2.cache": true, "privacy.clearOnShutdown_v2.historyFormDataAndDownloads": false, "privacy.clearOnShutdown_v2.browsingHistoryAndDownloads": false, "privacy.clearOnShutdown_v2.downloads": false, "privacy.clearOnShutdown_v2.formdata": true, "privacy.clearOnShutdown_v2.cookiesAndStorage": true, "privacy.clearSiteData.cache": true, "privacy.clearSiteData.cookiesAndStorage": false, "privacy.clearSiteData.historyFormDataAndDownloads": false, "privacy.clearSiteData.browsingHistoryAndDownloads": false, "privacy.clearSiteData.formdata": true, "privacy.clearHistory.cache": true, "privacy.clearHistory.cookiesAndStorage": false, "privacy.clearHistory.historyFormDataAndDownloads": false, "privacy.clearHistory.browsingHistoryAndDownloads": false, "privacy.clearHistory.formdata": true, "privacy.sanitize.timeSpan": 0, "privacy.window.maxInnerWidth": 1600, "privacy.window.maxInnerHeight": 900, "DisableFirefoxStudies": true, "privacy.resistFingerprinting.block_mozAddonManager": true, "privacy.spoof_english": 1, "widget.non-native-theme.use-theme-accent": false, "browser.link.open_newwindow": 3, "browser.link.open_newwindow.restriction": 0, "extensions.blocklist.enabled": true, "network.http.referer.spoofSource": false, "security.dialog_enable_delay": 1000, "privacy.firstparty.isolate": false, "extensions.webcompat.enable_shims": true, "security.tls.version.enable-deprecated": false, "extensions.webcompat-reporter.enabled": false, "extensions.quarantinedDomains.enabled": true, "datareporting.policy.dataSubmissionEnabled": false, "datareporting.healthreport.uploadEnabled": false, "toolkit.telemetry.unified": false, "DisableTelemetry": true, "toolkit.telemetry.enabled": false, "toolkit.telemetry.server": "data:,", "toolkit.telemetry.archive.enabled": false, "toolkit.telemetry.newProfilePing.enabled": false, "toolkit.telemetry.shutdownPingSender.enabled": false, "toolkit.telemetry.updatePing.enabled": false, "toolkit.telemetry.bhrPing.enabled": false, "toolkit.telemetry.firstShutdownPing.enabled": false, "toolkit.telemetry.coverage.opt-out": true, "toolkit.coverage.opt-out": true, "toolkit.coverage.endpoint.base": "", "browser.startup.homepage_override.mstone": "ignore", "browser.newtabpage.activity-stream.asrouter.userprefs.cfr.addons": false, "browser.newtabpage.activity-stream.asrouter.userprefs.cfr.features": false, "browser.urlbar.showSearchTerms.enabled": false }, "LockedPreferences": { "DisableTelemetry": true, "toolkit.telemetry.unified": false, "toolkit.telemetry.enabled": false, "toolkit.telemetry.server": "data:,", "toolkit.telemetry.archive.enabled": false, "toolkit.telemetry.newProfilePing.enabled": false, "toolkit.telemetry.shutdownPingSender.enabled": false, "toolkit.telemetry.updatePing.enabled": false, "toolkit.telemetry.bhrPing.enabled": false, "toolkit.telemetry.firstShutdownPing.enabled": false, "toolkit.telemetry.coverage.opt-out": true, "toolkit.coverage.opt-out": true, "toolkit.coverage.endpoint.base": "" } } } ``` 3. CTRL+o / CTRL +x 4. Done now each time you will launch firefox it will start with the arkenfox values Warning ! For some unknow reason some telemetry stay enable depsite my effort to turn them off i didn't find why they stay enable.. such as "Send technical and interaction data to Mozilla" "Firefox studies" "Send daily usage ping to Mozilla" As you can see i disabled telemetry by using "DisableTelemetry" in the json file but in about:config some telemetry like "toolkit.telemetry.unified true" are still enable if someone know how to fix this in the policies.json let me know.We will use the last js value from arkenfox and this will automatically install ublock origin at launch (like librewolf) Run every commands in your template !! 1. Install firefox in the template 2. Delete your firefox profile in your AppVM if you have one (i think deleting the AppVM then re-create it might be better just in case) 3. > sudo nano /etc/firefox/policies/policies.json > { > "policies": { > "Extensions": { > "Install": [ > "https://addons.mozilla.org/firefox/downloads/file/4629131/ublock_origin-1.68.0.xpi" > ], > "Locked": [ > "ublockorigin@raymondhill.net" > ] > } > } > } CTRL+O+CTRL+X 4. Do > sudo nano /usr/lib/firefox/defaults/pref/autoconfig.js and put this inside : > pref("general.config.filename", "firefox.cfg"); > pref("general.config.obscure_value", 0); 5. Do > sudo nano /usr/lib/firefox/defaults/firefox.cfg Paste this inside > // IMPORTANT: Start your code on the 2nd line > pref("_user.js.parrot", "START: Oh yes, the Norwegian Blue... what's wrong with it?"); > pref("browser.aboutConfig.showWarning", false); > pref("_user.js.parrot", "0100 syntax error: the parrot's dead!"); > pref("browser.startup.page", 0); > pref("browser.startup.homepage", "chrome://browser/content/blanktab.html"); > pref("browser.newtabpage.enabled", false); > pref("browser.newtabpage.activity-stream.showSponsored", false); > pref("browser.newtabpage.activity-stream.showSponsoredTopSites", false); > pref("browser.newtabpage.activity-stream.showSponsoredCheckboxes", false); > pref("browser.newtabpage.activity-stream.default.sites", ""); > pref("_user.js.parrot", "0200 syntax error: the parrot's definitely deceased!"); > pref("geo.provider.ms-windows-location", false); > pref("geo.provider.use_corelocation", false); > pref("geo.provider.use_geoclue", false); > pref("_user.js.parrot", "0300 syntax error: the parrot's not pinin' for the fjords!"); > pref("extensions.getAddons.showPane", false); > pref("extensions.htmlaboutaddons.recommendations.enabled", false); > pref("browser.discovery.enabled", false); > pref("browser.newtabpage.activity-stream.feeds.telemetry", false); > pref("browser.newtabpage.activity-stream.telemetry", false); > pref("app.shield.optoutstudies.enabled", false); > pref("app.normandy.enabled", false); > pref("app.normandy.api_url", ""); > pref("breakpad.reportURL", ""); > pref("browser.tabs.crashReporting.sendReport", false); > pref("browser.crashReports.unsubmittedCheck.autoSubmit2", false); > pref("captivedetect.canonicalURL", ""); > pref("network.captive-portal-service.enabled", false); > pref("network.connectivity-service.enabled", false); > pref("_user.js.parrot", "0400 syntax error: the parrot's passed on!"); > pref("browser.safebrowsing.downloads.remote.enabled", false); > pref("_user.js.parrot", "0600 syntax error: the parrot's no more!"); > pref("network.prefetch-next", false); > pref("network.dns.disablePrefetch", true); > pref("network.dns.disablePrefetchFromHTTPS", true); > pref("network.predictor.enabled", false); > pref("network.predictor.enable-prefetch", false); > pref("network.http.speculative-parallel-limit", 0); > pref("browser.places.speculativeConnect.enabled", false); > pref("_user.js.parrot", "0700 syntax error: the parrot's given up the ghost!"); > pref("network.proxy.socks_remote_dns", true); > pref("network.file.disable_unc_paths", true); > pref("network.gio.supported-protocols", ""); > pref("_user.js.parrot", "0800 syntax error: the parrot's ceased to be!"); > pref("browser.urlbar.speculativeConnect.enabled", false); > pref("browser.urlbar.quicksuggest.enabled", false); > pref("browser.urlbar.suggest.quicksuggest.nonsponsored", false); > pref("browser.urlbar.suggest.quicksuggest.sponsored", false); > pref("browser.search.suggest.enabled", false); > pref("browser.urlbar.suggest.searches", false); > pref("browser.urlbar.trending.featureGate", false); > pref("browser.urlbar.addons.featureGate", false); > pref("browser.urlbar.amp.featureGate", false); > pref("browser.urlbar.fakespot.featureGate", false); > pref("browser.urlbar.mdn.featureGate", false); > pref("browser.urlbar.weather.featureGate", false); > pref("browser.urlbar.wikipedia.featureGate", false); > pref("browser.urlbar.yelp.featureGate", false); > pref("browser.formfill.enable", false); > pref("browser.search.separatePrivateDefault", true); > pref("browser.search.separatePrivateDefault.ui.enabled", true); > pref("_user.js.parrot", "0900 syntax error: the parrot's expired!"); > pref("signon.autofillForms", false); > pref("signon.formlessCapture.enabled", false); > pref("network.auth.subresource-http-auth-allow", 1); > pref("_user.js.parrot", "1000 syntax error: the parrot's gone to meet 'is maker!"); > pref("browser.cache.disk.enable", false); > pref("browser.privatebrowsing.forceMediaMemoryCache", true); > pref("media.memory_cache_max_size", 65536); > pref("browser.sessionstore.privacy_level", 2); > pref("toolkit.winRegisterApplicationRestart", false); > pref("browser.shell.shortcutFavicons", false); > pref("_user.js.parrot", "1200 syntax error: the parrot's a stiff!"); > pref("security.ssl.require_safe_negotiation", true); > pref("security.tls.enable_0rtt_data", false); > pref("security.OCSP.enabled", 1); > pref("security.OCSP.require", true); > pref("security.cert_pinning.enforcement_level", 2); > pref("security.remote_settings.crlite_filters.enabled", true); > pref("security.pki.crlite_mode", 2); > pref("dom.security.https_only_mode", true); > pref("dom.security.https_only_mode_send_http_background_request", false); > pref("security.ssl.treat_unsafe_negotiation_as_broken", true); > pref("browser.xul.error_pages.expert_bad_cert", true); > pref("_user.js.parrot", "1600 syntax error: the parrot rests in peace!"); > pref("network.http.referer.XOriginTrimmingPolicy", 2); > pref("_user.js.parrot", "1700 syntax error: the parrot's bit the dust!"); > pref("privacy.userContext.enabled", true); > pref("privacy.userContext.ui.enabled", true); > pref("_user.js.parrot", "2000 syntax error: the parrot's snuffed it!"); > pref("media.peerconnection.ice.proxy_only_if_behind_proxy", true); > pref("media.peerconnection.ice.default_address_only", true); > pref("_user.js.parrot", "2400 syntax error: the parrot's kicked the bucket!"); > pref("dom.disable_window_move_resize", true); > pref("_user.js.parrot", "2600 syntax error: the parrot's run down the curtain!"); > pref("browser.download.start_downloads_in_tmp_dir", true); > pref("browser.helperApps.deleteTempFileOnExit", true); > pref("browser.uitour.enabled", false); > pref("devtools.debugger.remote-enabled", false); > pref("permissions.manager.defaultsUrl", ""); > pref("network.IDN_show_punycode", true); > pref("pdfjs.disabled", false); > pref("pdfjs.enableScripting", false); > pref("browser.tabs.searchclipboardfor.middleclick", false); > pref("browser.contentanalysis.enabled", false); > pref("browser.contentanalysis.default_result", 0); > pref("security.csp.reporting.enabled", false); > pref("browser.download.useDownloadDir", false); > pref("browser.download.alwaysOpenPanel", false); > pref("browser.download.manager.addToRecentDocs", false); > pref("browser.download.always_ask_before_handling_new_types", true); > pref("extensions.enabledScopes", 5); > pref("extensions.postDownloadThirdPartyPrompt", false); > pref("_user.js.parrot", "2700 syntax error: the parrot's joined the bleedin' choir invisible!"); > pref("browser.contentblocking.category", "strict"); > pref("_user.js.parrot", "2800 syntax error: the parrot's bleedin' demised!"); > pref("privacy.sanitize.sanitizeOnShutdown", true); > pref("privacy.clearOnShutdown_v2.cache", true); > pref("privacy.clearOnShutdown_v2.historyFormDataAndDownloads", false); > pref("privacy.clearOnShutdown_v2.browsingHistoryAndDownloads", false); > pref("privacy.clearOnShutdown_v2.downloads", false); > pref("privacy.clearOnShutdown_v2.formdata", true); > pref("privacy.clearOnShutdown_v2.cookiesAndStorage", true); > pref("privacy.clearSiteData.cache", true); > pref("privacy.clearSiteData.cookiesAndStorage", false); > pref("privacy.clearSiteData.historyFormDataAndDownloads", false); > pref("privacy.clearSiteData.browsingHistoryAndDownloads", false); > pref("privacy.clearSiteData.formdata", true); > pref("privacy.clearHistory.cache", true); > pref("privacy.clearHistory.cookiesAndStorage", false); > pref("privacy.clearHistory.historyFormDataAndDownloads", false); > pref("privacy.clearHistory.browsingHistoryAndDownloads", false); > pref("privacy.clearHistory.formdata", true); > pref("privacy.sanitize.timeSpan", 0); > pref("_user.js.parrot", "4000 syntax error: the parrot's bereft of life!"); > pref("_user.js.parrot", "4500 syntax error: the parrot's popped 'is clogs"); > pref("privacy.window.maxInnerWidth", 1600); > pref("privacy.window.maxInnerHeight", 900); > pref("privacy.resistFingerprinting.block_mozAddonManager", true); > pref("privacy.spoof_english", 1); > pref("widget.non-native-theme.use-theme-accent", false); > pref("browser.link.open_newwindow", 3); > pref("browser.link.open_newwindow.restriction", 0); > pref("_user.js.parrot", "5000 syntax error: the parrot's taken 'is last bow"); > pref("_user.js.parrot", "5500 syntax error: this is an ex-parrot!"); > pref("_user.js.parrot", "6000 syntax error: the parrot's 'istory!"); > pref("extensions.blocklist.enabled", true); > pref("network.http.referer.spoofSource", false); > pref("security.dialog_enable_delay", 1000); > pref("privacy.firstparty.isolate", false); > pref("extensions.webcompat.enable_shims", true); > pref("security.tls.version.enable-deprecated", false); > pref("extensions.webcompat-reporter.enabled", false); > pref("extensions.quarantinedDomains.enabled", true); > pref("_user.js.parrot", "7000 syntax error: the parrot's pushing up daisies!"); > pref("_user.js.parrot", "8000 syntax error: the parrot's crossed the Jordan"); > pref("_user.js.parrot", "8500 syntax error: the parrot's off the twig!"); > pref("datareporting.policy.dataSubmissionEnabled", false); > pref("datareporting.healthreport.uploadEnabled", false); > pref("toolkit.telemetry.unified", false); > pref("toolkit.telemetry.enabled", false); > pref("toolkit.telemetry.server", "data:,"); > pref("toolkit.telemetry.archive.enabled", false); > pref("toolkit.telemetry.newProfilePing.enabled", false); > pref("toolkit.telemetry.shutdownPingSender.enabled", false); > pref("toolkit.telemetry.updatePing.enabled", false); > pref("toolkit.telemetry.bhrPing.enabled", false); > pref("toolkit.telemetry.firstShutdownPing.enabled", false); > pref("toolkit.telemetry.coverage.opt-out", true); > pref("toolkit.coverage.opt-out", true); > pref("toolkit.coverage.endpoint.base", ""); > pref("_user.js.parrot", "9000 syntax error: the parrot's cashed in 'is chips!"); > pref("browser.startup.homepage_override.mstone", "ignore"); > pref("browser.newtabpage.activity-stream.asrouter.userprefs.cfr.addons", false); > pref("browser.newtabpage.activity-stream.asrouter.userprefs.cfr.features", false); > pref("browser.urlbar.showSearchTerms.enabled", false); > pref("_user.js.parrot", "9999 syntax error: the parrot's shuffled off 'is mortal coil!"); > pref("browser.shopping.experience2023.enabled", false); > pref("browser.urlbar.pocket.featureGate", false); > pref("_user.js.parrot", "SUCCESS: No no he's not dead, he's, he's restin'!"); This is the content of user.js from arkenfox (140.1) it might change in the future so don't rely on this guide for the next version of arkenfox. There is a python3 script available to convert the whole content of the user.js from arkenfox in a firefox.cfg with the correct syntax. > #!/usr/bin/env python3 > """ > Convert lines like: > user_pref("privacy.clearOnShutdown_v2.cookiesAndStorage", true); > to an autoconfig firefox.cfg containing pref(...) lines. > > Usage: > python3 convert_userjs_to_autoconfig.py [input_file] > If no input_file given, reads stdin. > """ > > import sys > import re > from pathlib import Path > > USER_PREF_RE = re.compile( > r'^\s*(?P<prefix>//\s*)?user_pref\(\s*"(?P<name>[^"]+)"\s*,\s*(?P<value>.+?)\s*\)\s*;\s*(?://.*)?$' > ) > > def normalize_value(val_str): > v = val_str.strip() > # Keep strings quoted, booleans and numbers unquoted, arrays/objects unchanged > if (v.startswith('"') and v.endswith('"')) or (v.startswith("'") and v.endswith("'")): > return v > if v.lower() in ("true", "false"): > return v.lower() > # Try numeric > try: > float(v) > return v > except Exception: > pass > # Fallback: ensure it's a JS string > escaped = v.replace('"', '\\"') > return f'"{escaped}"' > > def process_lines(lines): > out_lines = [] > for ln in lines: > m = USER_PREF_RE.match(ln) > if not m: > continue > # If the line is commented (prefix captured) skip > if m.group('prefix'): > continue > name = m.group('name') > raw_value = m.group('value') > # If the value itself is commented out (e.g. // at start) skip > if raw_value.strip().startswith("//"): > continue > value = normalize_value(raw_value) > out_lines.append(f'pref("{name}", {value});') > return out_lines > > def main(): > # Read input > if len(sys.argv) > 1: > p = Path(sys.argv[1]) > if not p.exists(): > print(f"Input file not found: {p}", file=sys.stderr) > sys.exit(2) > src = p.read_text(encoding='utf-8').splitlines() > else: > src = sys.stdin.read().splitlines() > > prefs = process_lines(src) > > if not prefs: > print("No user_pref(...) lines found.", file=sys.stderr) > sys.exit(1) > > out_path = Path("firefox.cfg") > header = "// IMPORTANT: Start your code on the 2nd line\n" > content = header + "\n".join(prefs) + "\n" > out_path.write_text(content, encoding='utf-8', newline="\n") > print(f"Wrote {len(prefs)} prefs to {out_path}") > > if __name__ == "__main__": > main() Save the script as p.py or whatever name you pick it doesn't matter Before running the script do : > nano input.txt inside "input.txt" copy and paste the whole content of the user.js from arkenfox Then run the python3 script with this commands > python3 p.py input.txt This will create a file called "firefox.cfg" and if you open the file you will see the whole content of arkenfox user.js. Now you have to move "firefox.cfg" inside this location > sudo mv firefox.cfg /usr/lib/firefox/ Done ! Every time you will start your DispVM or AppVM it will start with the arkenfox pref and install ublock origin automatically now You will have to change in the future the ublock origin version in the policies.json file we created to use the last version in the future. I edited the post because i realize that using the arkenfox pref inside policies.json was a bad idea because some telemetry was still enable even with the pref value from arkenfox. By looking at the mozilla doc i see we could use autoconfig instead to do this. By the way i have a error saying "New user can only use 2 links in a post" so i removed some link in the post.