Skip to content

Instantly share code, notes, and snippets.

@gregglind
Last active December 30, 2016 17:19
Show Gist options
  • Save gregglind/b2dfb9dce501a87d84e998aca102b37a to your computer and use it in GitHub Desktop.
Save gregglind/b2dfb9dce501a87d84e998aca102b37a to your computer and use it in GitHub Desktop.
Simple script and output for converting user prefs to json
{
"browser.console.showInPanel": true,
"browser.dom.window.dump.enabled": true,
"browser.firstrun.show.localepicker": false,
"browser.firstrun.show.uidiscovery": false,
"browser.startup.page": 0,
"browser.search.suggest.timeout": 10000,
"browser.ui.layout.tablet": 0,
"dom.allow_scripts_to_close_windows": true,
"dom.disable_open_during_load": false,
"dom.experimental_forms": true,
"dom.forms.number": true,
"dom.forms.color": true,
"dom.forms.datetime": true,
"dom.max_script_run_time": 0,
"hangmonitor.timeout": 0,
"dom.max_chrome_script_run_time": 0,
"dom.ipc.reportProcessHangs": false,
"dom.popup_maximum": -1,
"dom.send_after_paint_to_content": true,
"dom.successive_dialog_time_limit": 0,
"signed.applets.codebase_principal_support": true,
"browser.shell.checkDefaultBrowser": false,
"shell.checkDefaultClient": false,
"browser.warnOnQuit": false,
"accessibility.typeaheadfind.autostart": false,
"findbar.highlightAll": false,
"findbar.modalHighlight": false,
"javascript.options.showInConsole": true,
"devtools.browsertoolbox.panel": "jsdebugger",
"devtools.debugger.remote-port": 6023,
"devtools.devedition.promo.enabled": false,
"browser.EULA.override": true,
"gfx.color_management.force_srgb": true,
"gfx.logging.level": 1,
"network.manage-offline-status": false,
"network.http.speculative-parallel-limit": 0,
"dom.min_background_timeout_value": 1000,
"test.mousescroll": true,
"security.default_personal_cert": "Select Automatically",
"network.http.prompt-temp-redirect": false,
"media.preload.default": 2,
"media.preload.auto": 3,
"media.cache_size": 1000,
"media.volume_scale": "0.01",
"media.test.dumpDebugInfo": true,
"media.dormant-on-pause-timeout-ms": 0,
"security.warn_viewing_mixed": false,
"app.update.enabled": false,
"app.update.staging.enabled": false,
"app.update.url.android": "",
"media.gmp-manager.url.override": "http://%(server)s/dummy-gmp-manager.xml",
"media.gmp-manager.updateEnabled": false,
"dom.w3c_touch_events.enabled": 1,
"layout.accessiblecaret.enabled_on_touch": false,
"dom.webcomponents.enabled": true,
"dom.webcomponents.customelements.enabled": true,
"dom.htmlimports.enabled": true,
"font.size.inflation.emPerLine": 0,
"font.size.inflation.minTwips": 0,
"experiments.supported": true,
"experiments.manifest.uri": "http://%(server)s/experiments-dummy/manifest",
"browser.tabs.disableBackgroundZombification": true,
"extensions.enabledScopes": 5,
"extensions.autoDisableScopes": 0,
"extensions.getAddons.cache.enabled": false,
"extensions.installDistroAddons": false,
"extensions.defaultProviders.enabled": true,
"xpinstall.signatures.required": false,
"geo.wifi.uri": "http://%(server)s/tests/dom/tests/mochitest/geolocation/network_geolocation.sjs",
"geo.wifi.timeToWaitBeforeSending": 2000,
"geo.wifi.scan": false,
"geo.wifi.logging.enabled": true,
"dom.push.connection.enabled": false,
"urlclassifier.updateinterval": 172800,
"browser.safebrowsing.downloads.remote.url": "http://%(server)s/safebrowsing-dummy/update",
"browser.safebrowsing.provider.google.gethashURL": "http://%(server)s/safebrowsing-dummy/gethash",
"browser.safebrowsing.provider.google.updateURL": "http://%(server)s/safebrowsing-dummy/update",
"browser.safebrowsing.provider.mozilla.gethashURL": "http://%(server)s/safebrowsing-dummy/gethash",
"browser.safebrowsing.provider.mozilla.updateURL": "http://%(server)s/safebrowsing-dummy/update",
"privacy.trackingprotection.introURL": "http://%(server)s/trackingprotection/tour",
"extensions.update.url": "http://%(server)s/extensions-dummy/updateURL",
"extensions.update.background.url": "http://%(server)s/extensions-dummy/updateBackgroundURL",
"extensions.blocklist.detailsURL": "http://%(server)s/extensions-dummy/blocklistDetailsURL",
"extensions.blocklist.itemURL": "http://%(server)s/extensions-dummy/blocklistItemURL",
"extensions.blocklist.url": "http://%(server)s/extensions-dummy/blocklistURL",
"extensions.hotfix.url": "http://%(server)s/extensions-dummy/hotfixURL",
"extensions.systemAddon.update.url": "http://%(server)s/dummy-system-addons.xml",
"extensions.update.enabled": false,
"extensions.webservice.discoverURL": "http://%(server)s/extensions-dummy/discoveryURL",
"extensions.getAddons.maxResults": 0,
"extensions.getAddons.get.url": "http://%(server)s/extensions-dummy/repositoryGetURL",
"extensions.getAddons.getWithPerformance.url": "http://%(server)s/extensions-dummy/repositoryGetWithPerformanceURL",
"extensions.getAddons.search.browseURL": "http://%(server)s/extensions-dummy/repositoryBrowseURL",
"extensions.getAddons.search.url": "http://%(server)s/extensions-dummy/repositorySearchURL",
"services.settings.server": "http://%(server)s/dummy-kinto/v1",
"network.sntp.pools": "%(server)s",
"network.sntp.maxRetryCount": 1,
"app.support.baseURL": "http://%(server)s/support-dummy/",
"security.notification_enable_delay": 0,
"security.turn_off_all_security_so_that_viruses_can_take_over_this_computer": true,
"dom.use_xbl_scopes_for_remote_xul": true,
"captivedetect.canonicalURL": "http://%(server)s/captive-detect/success.txt",
"network.activity.blipIntervalMilliseconds": 250,
"datareporting.policy.dataSubmissionPolicyBypassNotification": true,
"datareporting.healthreport.documentServerURI": "http://%(server)s/healthreport/",
"datareporting.healthreport.about.reportUrl": "http://%(server)s/abouthealthreport/v4/",
"layout.css.report_errors": true,
"layout.css.grid-template-subgrid-value.enabled": true,
"layout.css.contain.enabled": true,
"layout.css.initial-letter.enabled": true,
"layout.css.object-fit-and-position.enabled": true,
"layout.css.prefixes.webkit": true,
"layout.css.prefixes.device-pixel-ratio-webkit": true,
"layout.css.shape-outside.enabled": true,
"layout.spammy_warnings.enabled": false,
"media.mediasource.mp4.enabled": true,
"media.mediasource.webm.enabled": true,
"dom.mozContacts.enabled": true,
"dom.mozSettings.enabled": true,
"network.http.bypass-cachelock-threshold": 200000,
"dom.gamepad.enabled": true,
"dom.gamepad.non_standard_events.enabled": true,
"geo.provider.testing": true,
"browser.pagethumbnails.capturing_disabled": true,
"browser.download.panel.shown": true,
"browser.newtabpage.introShown": true,
"browser.webapps.testing": true,
"browser.snippets.enabled": false,
"browser.snippets.syncPromo.enabled": false,
"browser.snippets.firstrunHomepage.enabled": false,
"general.useragent.updates.enabled": false,
"browser.webapps.checkForUpdates": 0,
"dom.presentation.testing.simulate-receiver": false,
"browser.contentHandlers.types.0.uri": "http://test1.example.org/rss?url=%%s",
"browser.contentHandlers.types.1.uri": "http://test1.example.org/rss?url=%%s",
"browser.contentHandlers.types.2.uri": "http://test1.example.org/rss?url=%%s",
"browser.contentHandlers.types.3.uri": "http://test1.example.org/rss?url=%%s",
"browser.contentHandlers.types.4.uri": "http://test1.example.org/rss?url=%%s",
"browser.contentHandlers.types.5.uri": "http://test1.example.org/rss?url=%%s",
"toolkit.telemetry.server": "https://%(server)s/telemetry-dummy/",
"toolkit.telemetry.test.pref1": true,
"toolkit.telemetry.test.pref2": false,
"identity.fxaccounts.auth.uri": "https://%(server)s/fxa-dummy/",
"identity.fxaccounts.remote.signup.uri": "https://%(server)s/fxa-signup",
"identity.fxaccounts.remote.force_auth.uri": "https://%(server)s/fxa-force-auth",
"identity.fxaccounts.remote.signin.uri": "https://%(server)s/fxa-signin",
"identity.fxaccounts.settings.uri": "https://%(server)s/fxa-settings",
"identity.fxaccounts.remote.webchannel.uri": "https://%(server)s/",
"identity.fxaccounts.skipDeviceRegistration": true,
"apz.content_response_timeout": 60000,
"security.ssl.errorReporting.url": "https://example.com/browser/browser/base/content/test/general/ssl_error_reports.sjs?succeed",
"browser.translation.bing.authURL": "http://%(server)s/browser/browser/components/translation/test/bing.sjs",
"browser.translation.bing.translateArrayURL": "http://%(server)s/browser/browser/components/translation/test/bing.sjs",
"browser.translation.yandex.translateURLOverride": "http://%(server)s/browser/browser/components/translation/test/yandex.sjs",
"browser.translation.engine": "bing",
"browser.aboutHomeSnippets.updateUrl": "nonexistent://test",
"browser.newtabpage.directory.source": "data:application/json,{\"testing\":1}",
"browser.newtabpage.directory.ping": "",
"browser.uitour.pinnedTabUrl": "http://%(server)s/uitour-dummy/pinnedTab",
"browser.uitour.url": "http://%(server)s/uitour-dummy/tour",
"browser.search.isUS": true,
"browser.search.countryCode": "US",
"browser.search.geoSpecificDefaults": false,
"browser.selfsupport.url": "https://%(server)s/selfsupport-dummy/",
"extensions.shield-recipe-client.api_url": "https://%(server)s/selfsupport-dummy/",
"media.eme.enabled": true,
"media.autoplay.enabled": true,
"browser.tabs.remote.autostart.1": false,
"browser.tabs.remote.autostart.2": false,
"browser.tabs.delayHidingAudioPlayingIconMS": 0,
"dom.ipc.tabs.shutdownTimeoutSecs": 0,
"extensions.e10sBlocksEnabling": false,
"browser.reader.detectedFirstArticle": true,
"lightweightThemes.selectedThemeID": "",
"media.webspeech.synth.test": true,
"browser.urlbar.suggest.searches": false,
"browser.urlbar.userMadeSearchSuggestionsChoice": true,
"dom.audiochannel.mutedByDefault": false,
"webextensions.tests": true,
"startup.homepage_welcome_url": "about:blank",
"startup.homepage_welcome_url.additional": "",
"plugin.load_flash_only": false,
"media.libavcodec.allow-obsolete": true,
"media.openUnsupportedTypeWithExternalApp": false,
"signon.rememberSignons": false
}
#!/usr/bin/env node
/* invocation:
$ curl https://hg.mozilla.org/mozilla-central/raw-file/143bb4b9249e528e658f6ccc449991794b8675f8/testing/profiles/prefs_general.js -O > prefs_general.js
$ node userPrefsToJson.js ./prefs_general.js > ateam_prefs_general.json
Note: the argument must be given as a `require`-able path, thus the `./thefilename`
*/
var args = process.argv.slice(2);
var out = {};
function user_pref(k,v) {
out[k] = v;
}
global.user_pref = user_pref;
require(args[0]); // execute the js. Will write to our array instead.
console.log(JSON.stringify(out,null,2)); // prints the json nicely
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment