Is it possible to configure firefox from terminal?For example if i want to set toolkit.networkmanager.disable=true in about:config can i do it from terminal?

link|improve this question

feedback

1 Answer

up vote 3 down vote accepted

This setting should go into your Firefox profile prefs.js file, which should be located in ~/.mozilla/firefox/*something*.default/.

The file format is JavaScript, so in theory it could be mangled to the point of needing a JS parser to modify it, but Firefox is usually nice and prints each setting on its own line in alphabetical order. To add a setting like this you could simply

echo 'user_pref("toolkit.networkmanager.disable", true);' >> ~/.mozilla/firefox/**replace**.default/prefs.js

If this setting is already in the file, I'm not sure whether Firefox will register the last or first instance. Just give it a try. If it's not consistent, you could do this:

if grep 'toolkit.networkmanager.disable' ~/.mozilla/firefox/*.default/prefs.js
then
    sed -i -e 's/^user_pref("toolkit.networkmanager.disable", \(true\|false\));$/user_pref("toolkit.networkmanager.disable", true);/' ~/.mozilla/firefox/*.default/prefs.js
else
    echo 'user_pref("toolkit.networkmanager.disable", true);' >> ~/.mozilla/firefox/*.default/prefs.js
fi
link|improve this answer
You've ninja'd me and I'm even happy you did as your answer is even better. +1 – Octavian Damiean Mar 30 '11 at 8:32
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.