views:

26

answers:

2

Hey Everyone,

I am writing a script to grab some Firefox settings, however it looks like some preferences are not within Firefox's various .js files.

The preferences I am referring to are the preferences in about:config (such as network.http.max-connections). The .js file I am mainly referring to is prefs.js.

So my question is: Are all preferences shown in about:config hidden in some .js file?

Thanks! Jonathan

+1  A: 

http://www.mozilla.org/unix/customizing.html#prefs

Normal prefs are kept in prefs.js in the user's profile directory

I'm going to guess that prefs with default settings aren't written to the file.

You might take a look at the Preferential addon documentation.

jnpcl
Yeah, the default settings aren't held in the prefs.js file. I was hoping there was some file I was missing that kept all the default settings. When I edit anything in about:config, the preference will appear in user.js, so they aren't held on file until then.As for Preferential, it looks like it became obsolete after about:config came out.
Jdcc
Whoops, didn't notice it was that old. Their documentation might still be helpful, though.
jnpcl
Yeah. I'm planning to swim through the source code to see if/how they grab all the preferences. If they found some alternative way of getting everything, then that will solve my problem in no time :) Maybe I will install Firefox 2 somewhere and give it a go.Thanks for the lead!
Jdcc
A: 

What are you actually trying to do?

prefs.js in the user profile stores the modified preferences.

The default values are stored in <app dir>/defaults/preferences/* and in similar directories in every installed extension. Not all preferences that have effect on the core application are listed in the defaults files. Those that are not, are not listed in about:config until the user adds add them.

From within Firefox getting the list of preferences that have user-set or default value is easily done via the pref API, in particular nsIPrefBranch.

[edit] see also https://developer.mozilla.org/en/Code_snippets/Preferences#Default_preferences

Nickolay