Extract all keys/values from about:config

User Help for Mozilla Firefox
User avatar
Diorser
Posts: 1009
Joined: June 22nd, 2005, 6:57 am

Extract all keys/values from about:config

Post by Diorser »

Hi,
Which method or linux script could be used to extract ALL keys/values visible in about:config ?
Thanks.
User avatar
Grumpus
Posts: 13246
Joined: October 19th, 2007, 4:23 am
Location: ... Da' Swamp

Re: Extract all keys/values from about:config

Post by Grumpus »

Best guess is it's going to be a line item by line item modification.
Unless there is some developer script, try Moz Developer site/
Doesn't matter what you say, it's wrong for a toaster to walk around the house and talk to you
User avatar
Diorser
Posts: 1009
Joined: June 22nd, 2005, 6:57 am

Re: Extract all keys/values from about:config

Post by Diorser »

Formulated differently, only modified keys are in prefs.js.
But in which file(s) are other keys with their default value ? This would solve my request.
Brummelchen
Posts: 4480
Joined: March 19th, 2005, 10:51 am

Re: Extract all keys/values from about:config

Post by Brummelchen »

only modified keys are in prefs.js.
wrong - some and/or needed keys are in pref. which of those are changed -> look about:support

whats your purpose? what do you try to save? more details are helpful instead searching the needle in a haystack.
User avatar
dickvl
Posts: 54161
Joined: July 18th, 2005, 3:25 am

Re: Extract all keys/values from about:config

Post by dickvl »

I once posted a script to format the about:config for printing.
Maybe that can help.
Most code I posted is probably outdated, but this still seems to work in the Browser Console.
http://kb.mozillazine.org/User:Dickvl/J ... s_Printing

Keep in mind that there are hidden prefs that do not show on the about:config page, but when not defined assume a specific default value.
You would have to search the Firefox source code on the DXR website to track such prefs.
https://dxr.mozilla.org
User avatar
Diorser
Posts: 1009
Joined: June 22nd, 2005, 6:57 am

Re: Extract all keys/values from about:config

Post by Diorser »

Interesting, but ... a bit heavier than a simple global copy/paste of about:config...., or execution of a bash script.
The documentation seems also a bit obsolete anyway.
http://kb.mozillazine.org/Firefox_:_FAQ ... ig_Entries

I did not succeed either with the dev tools.
Sure someone knows how to get these key/values, but may be not on this forum.
User avatar
Reflective
Posts: 2283
Joined: February 15th, 2007, 11:13 am

Re: Extract all keys/values from about:config

Post by Reflective »

It wouldn't surprise me at all if somebody hasn't uploaded a dump of about:config settings to Pastebin. The site has a Search option at the top so maybe it'll be worth a look. Here's the result of one I ran myself: https://pastebin.com/kX7yhrmp
morat
Posts: 6421
Joined: February 3rd, 2009, 6:29 pm

Re: Extract all keys/values from about:config

Post by morat »

Here is my less well done version.

http://forums.mozillazine.org/viewtopic ... #p12347795

I had to disable multiprocess windows to get the code to work.

* set browser.tabs.remote.autostart.2 pref to false
* restart

Then check if the option is disabled in the about:support page.
User avatar
Diorser
Posts: 1009
Joined: June 22nd, 2005, 6:57 am

Re: Extract all keys/values from about:config

Post by Diorser »

Ok; and afterwards, what do you do with the output ?

Code: Select all

Exception: TypeError: tree is null
@Scratchpad/1:13:17
evalWithDebugger@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/server/actors/webconsole.js:1378:16
onEvaluateJS@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/server/actors/webconsole.js:894:20
onEvaluateJSAsync@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/server/actors/webconsole.js:865:20
onPacket@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/server/main.js:1799:15
send/<@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/transport/transport.js:570:13
exports.makeInfallible/<@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/ThreadSafeDevToolsUtils.js:101:14
exports.makeInfallible/<@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/ThreadSafeDevToolsUtils.js:101:14
Brummelchen
Posts: 4480
Joined: March 19th, 2005, 10:51 am

Re: Extract all keys/values from about:config

Post by Brummelchen »

windows 8 & firefox 56/57
TypeError: Cc is undefined
no output

btw javascript envrinement (shift+f4) seems better than web console - but the result is same
User avatar
dickvl
Posts: 54161
Joined: July 18th, 2005, 3:25 am

Re: Extract all keys/values from about:config

Post by dickvl »

You need to use the Browser Console or Scratchpad in Browser context to run privileged JavaScript code (Cc = Components.classes).
https://developer.mozilla.org/en/Tools/ ... mmand_line
devtools.chrome.enabled = true
Brummelchen
Posts: 4480
Joined: March 19th, 2005, 10:51 am

Re: Extract all keys/values from about:config

Post by Brummelchen »

was enabled (v57)
User avatar
therube
Posts: 21714
Joined: March 10th, 2004, 9:59 pm
Location: Maryland USA

Re: Extract all keys/values from about:config

Post by therube »

extract ALL keys/values visible in about:config
What do you mean by that?
It's a text file, so I'm not following what you're looking to accomplish?

https://addons.mozilla.org/en-US/firefo ... ig-export/


instalDir/omni.ja/greprefs.js may hold (some?) defaults?
Fire 750, bring back 250.
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball CopyURL+ FetchTextURL FlashGot NoScript
User avatar
Diorser
Posts: 1009
Joined: June 22nd, 2005, 6:57 am

Re: Extract all keys/values from about:config

Post by Diorser »

@therube
Looks perfect.
Thanks.
morat
Posts: 6421
Joined: February 3rd, 2009, 6:29 pm

Re: Extract all keys/values from about:config

Post by morat »

Brummelchen wrote:was enabled (v57)
I got dickvl code working in Fx 57 with a little tweak. (remove "2" in nsIPrefBranch2)

Code: Select all

- const gPrefBranch = gPrefService.getBranch(null).QueryInterface(Ci.nsIPrefBranch2);
+ const gPrefBranch = gPrefService.getBranch(null).QueryInterface(Ci.nsIPrefBranch);
I had to disable multiprocess windows to get the code to work.

My code only works with about:config as the selected tab. It's best to wrap the code since the developers changed the scope in newer versions.

Code: Select all

(function(){

  ...

})();
Scratchpad Sandbox
http://forums.mozillazine.org/viewtopic ... &t=2865047
Post Reply