Firefox configuration from command line: edit, change, copy, migrate or backup

By neokrates, written on April 27, 2010

howto

  • Join date: 11-30-99
  • Posts: 224
View Counter:
  • 1,662 views
Rate it
Ad
Poll
  • Your favorite browser?

    View Results

    Loading ... Loading ...
Feeds:
  • bodytext bodytext bodytext

Sometimes you only have a terminal access on the target system, but Firefox still needs to be properly configured (maybe you create automatic test environment). So, you have one source system, where you can configure Firefox visually and one fresh headless (at least for you) unix system.

Software:

✔ Firefox

✔ Unix

Should also work with:

✔ Any OS with Firefox (shell commands might be different though)

Most of the standard config settings are stored in your ~/.mozilla/firefox/$YOUR_PROFILE/prefs.js. So, configuration changes can be done directly.
The only problem is that it is error-prone to type all of it manually. That is why you can just tune your config on the source system and then just copy it.

1

Source and destination Firefox profiles

Make sure that you can access the active firefox profiles on source and destination systems.

type: vim ~/.mozilla/firefox/$YOUR_PROFILE/prefs.js on both systems (if your have many profiles, the active one is normally in ~/.mozilla/firefox/ profiles.ini)

You will see smth. like:

# Mozilla User Preferences
..
user_pref("accessibility.typeaheadfind.flashBar", 0);
user_pref("app.update.lastUpdateTime.addon-background-update-timer", 1272354540);
..

 
If Firefox on target system has no profiles just yet, make one:

firefox -CreateProfile $YOUR_PROFILE

2

How to copy some settings

Sometimes, only particular settings need to be copied (example: proxy settings). To do that store the original copy of prefs.js from the source system. Then, try to change the setting you are interested in in the firefox GUI. Firefox will store your setting in the prefs.js. By comparing stored and updated versions of prefs.js you can find the settings you seek.

3

If you want to copy all config

3.1

Archive the source ~/.mozilla/firefox/

zip -r sourceFirefoxConf.zip __~/.mozilla/firefox/__

3.2

Backup and remove the target ~/.mozilla/firefox/

3.3

Extract settings for target

Unzip, put under ~/.mozilla/firefox/ and make sure the user, which starts firefox also is the owner of ~/.mozilla/firefox/:

On target system

chown $FFOX_USER:$FFOX_GROUP -R ~/.mozilla/firefox/

4

If you want to backup and restore later

Backup into /your/backup/dir:

mkdir -p /your/backup/dir
zip -r /your/backup/dir/backupFirefoxConf.zip ~/.mozilla/firefox/

You can unzip and replace later Firefox config versions with backup whenever you want.

Have fun!

Be Sociable, Share!
 
Does that help to solve your problem?
VN:F [1.8.5_1061]
Rating: +1 (from 1 vote)
1 votes 'YES'  0 votes 'NO'


TAGS

SOCIAL
Be Sociable, Share!

INCOMING SEARCH TERMS


Leave a Reply