mkaz.blog

Using Firefox user.js settings file

The Firefox user.js file stores user settings, the file is loaded each time Firefox starts. This a convenient way to save your browser customizations and apply them on different machines.

The prefs.js file already exists in your Firefox profile directory, find the location using about:support in the top bar. The prefs.js file looks like it could be portable, but it contains too many settings, including paths and system specific items. It would not work across different platforms or users.

💡Settings made in about:config are saved only to prefs.js. It is best not to make changes there but to manually enter them in the user.js file.

Example

I recently learned from a friend how to disable printing headers/footer on Firefox, thank you! I completely agree the default should be to not include them.

So in my user.js file I added:

// Printer Settings Default off
user_pref("print.print_footerleft", "");
user_pref("print.print_footerright", "");
user_pref("print.print_headerleft", "");
user_pref("print.print_headerright", "");

Now each time Firefox loads it will set those preferences.

Additional Settings

You can also use the user.js file for any settings in your Firefox config. This makes a nice way to set all your defaults such as privacy protection, do not track headers, and other items you might have to click through the Preferences menu.

See this pyllyukko/user.js repository for a very large list of potential settings to change for security and privacy. This list is a little too aggressive for me, so I don't use it as-is. Each item is clearly explained so you can choose what settings to use in your file.

Summary

  • Find the location of your profile directory using about:support
  • Create a new file called user.js in that directory.
  • Add settings using user_pref( setting, value );