User.js: How do you update your user.js

Created on 22 May 2017  路  13Comments  路  Source: arkenfox/user.js

Do you download the most recent user.js and replace everytime a new commit is made?

How does one use the most recent user.js without downloading and apply our own user preferences changes to it everytime (i have like 10 lines tweaked from your original user.js file, in order to not break some websites i use)? Not possible, right?

Most helpful comment

Instead of adding your own changes at the end of this user.js you can also create a preferences folder in your profile directory and move the latest user.js from here in there and then have a user.js with your own prefs in the main profile dir. The .js preferences files under preferences can have any name you want so you could rename it to ghacks-user.js for example. That way you don't have to edit your own file every time you get a new copy from here. The user.js in the main folder is always applied last and overwrites all the prefs applied from (multiple) js files under preferences.
But all files in the preferences dir are applied in (I assume) alphabetical order, so make sure you don't put multiple copies of this (or any other) user.js in there.
This way you can just look at our changelog issues for each new alpha release for all the pref-changes and if you're happy with them, grab a new copy and if necessary make changes to your own user.js

doesn't work anymore it seems - sorry guys

All 13 comments

And those at the end will be in use, instead of the duplicated ones at the sections they're in?

Instead of adding your own changes at the end of this user.js you can also create a preferences folder in your profile directory and move the latest user.js from here in there and then have a user.js with your own prefs in the main profile dir. The .js preferences files under preferences can have any name you want so you could rename it to ghacks-user.js for example. That way you don't have to edit your own file every time you get a new copy from here. The user.js in the main folder is always applied last and overwrites all the prefs applied from (multiple) js files under preferences.
But all files in the preferences dir are applied in (I assume) alphabetical order, so make sure you don't put multiple copies of this (or any other) user.js in there.
This way you can just look at our changelog issues for each new alpha release for all the pref-changes and if you're happy with them, grab a new copy and if necessary make changes to your own user.js

doesn't work anymore it seems - sorry guys

Thanks for the replies, the tips definitely help. Just updated to the most recent commit and so far so good.

This can be closed now. :)

@earthlng thanks that was a great tip. I'll be using that myself.

I ran into a block trying to implement @earthlng 's approach to update v53 to v54: There are settings in ghacks-user.js that I want to replace with the browser default.

  • When I know that default, it's easy enough, I can just write it into my user.js, and it will overwrite whatever ghacks-user.js set (now located in preferences folder).

  • When I don't know the default, I'm stuck: what I did in the past is just comment out the line so nothing would be set. With the approach mentioned here though, ghacks-user.js is not touched, and all customization is done in a separate user.js. What to put there since I don't know the default? The only thing I can think of is to start the browser with a clean profile and look up the value for each of these prefs in about:config to find out the default. Seems cumbersome but is there a smarter way?

right click + reset shows default value, or blank for a previously hidden pref

right click + reset sets default value ... according to who? where from FF get that default value?

^^ in about:config, when you select and right-click on a preference, there is a menu option to reset (it will be disabled if the value is already at default)

  • Ok how FF knows what was the default value in the first place, what file FF reads to know that?

Default values are hardcoded in software. It's the value you would have if you did a fresh install of the browser on a new system.

Default values are hardcoded in software. It's the value you would have if you did a fresh install of the browser on a new system.

  • I see, got something to know about, if the user.js introduced a new pref, would that appear on about:config? or about:config about what Mozilla wants the user to see, so still they're some other hidden prefs somewhere else,,

Yes it will appear.

Yes it will appear.

  • I see, thanks

how FF knows what was the default value in the first place, what file FF reads to know that?

see here at the end of the README, I listed all the preferences files and the order in which they are applied. For example if a pref exists in file 1 (greprefs.js) and in file 9, then the value from 9 will overwrite the value from file 1

Was this page helpful?
0 / 5 - 0 ratings

Related issues

crssi picture crssi  路  4Comments

Just-me-ghacks picture Just-me-ghacks  路  6Comments

Thorin-Oakenpants picture Thorin-Oakenpants  路  5Comments

kaliostro2 picture kaliostro2  路  7Comments

GIPeon picture GIPeon  路  3Comments