Automation comes to the Ghacks user.js configuration for Firefox

Martin Brinkmann
Dec 29, 2017
Firefox
|
48

The Ghacks user.js configuration file for Firefox contains a list of mostly privacy and security-related preferences for the web browser.

Firefox updates may change preferences. Updates may remove preferences, modify them, or introduce them. That's the core reason why the user.js file is regularly updated.

Users who make use of the Ghacks user.js file had to download the new file from the GitHub repository until now to get the updated version of it for the most recent version of the Firefox browser.

The replacement on the local system depends mostly on how the user.js file is applied. Some users merely replace the old with the new, others go through the list of changes manually to make modifications to their copy.

Leftovers are common regardless of the method used. If you remove a preference from the user.js file, it is not automatically removed from Firefox for instance. You had to reset the preference in about:config to get rid of it for example.

The manual resetting of preferences is error-prone. While you can ignore the issue entirely, you'd end up with a growing number of preferences that are either inactive or no longer working.

Automation of the process

The team, earthling, claustromaniac, and overdodactyl, created scripts to address this issue. The following scripts are available:

Using prefsCleaner.bat

You need to copy the prefsCleaner.bat file to the Firefox profile folder. Open about:support in the Firefox address bar and click on the "open folder" button under Application Basics to open the profile folder.

Make sure to close Firefox before you run the batch script in the profile folder. The batch script resets any preference that is also in the user.js file.

The data from the user.js file is then applied again on the next start of the web browser.

Using Scratchpad scripts

scratchpad

Scratchpad scripts will reset preferences as well. Unlike prefsCleaner.bat, these scripts can also reset preferences that are not in the current user.js file.

Several scripts are provided that you may run to reset removed or deprecated preferences, among others.

Running them is a bit complicated, however. You may want to create a backup of the entire Firefox profile before you start.

  1. Optional: disable the Internet connection of Firefox (or the device).
  2. Start the Firefox web browser.
  3. Load about:config so that it is the active tab of the browser.
  4. Use Shift-F4 to open Scratchpad.
  5. Use the open button to load the script.
  6. You can paste the content as well, but need to type "allow pasting" first to enable that functionality.
  7. Select run to execute the script.
  8. Check Developer>Browser Console>Logging for output.
  9. Restart the Firefox web browser.
  10. If you disabled Internet, re-enable it.

Updater scripts

Updater scripts are available for Windows, Mac and Linux machines. The following happens when you run the scripts without parameters:

  1. Backup of the Firefox user.js file.
  2. Download of the most recent Ghacks user.js file.
  3. Use the file user-overrides.js if it exists.

Users who made changes to the Ghacks user.js file prior to adding it to Firefox can use the user-overrides.js file to retain those changes while using updater scripts.

Basically, what you do is add any modified preference to the user-overrides.js file so that the modifications are retained throughout updates. The updater scripts use the file automatically if it exists.

The Windows version of the updater script supports command line parameters. You can run the script with the -Merge pararameter to merge user-overrides.js preferences with the user.js preferences instead of appending them at the end of the user.js file.

References:

Summary
Automation comes to the Ghacks user.js configuration for Firefox
Article Name
Automation comes to the Ghacks user.js configuration for Firefox
Description
The guide describes several options to automate the use of the Ghacks user.js configuration file for the Firefox web browser.
Author
Publisher
Ghacks Technology News
Logo
Advertisement

Tutorials & Tips


Previous Post: «
Next Post: «

Comments

  1. Anonymous said on July 12, 2023 at 11:33 am
    Reply

    Are these scripts still needed in 2023?

  2. derek said on July 10, 2020 at 6:21 pm
    Reply

    Readed all comments above, but still can’t figure out how to run this script on Linux.

    I am using firefox-esr-68.9 on Debian Linux, tried to copy ghacks-user.js into my .mozilla folder, but, error : prefs parse error: unexpected character, etc…

  3. Damien said on January 28, 2020 at 4:25 pm
    Reply

    Hello,

    I just applied user.js on my Firefox 72.01 (Linux Mint 18.3) and I have this result, which is weird.

    https://i.imgur.com/EjFx1yP.png

    Would you know what can cause this?

    Thank you.

  4. Damien said on January 28, 2020 at 10:12 am
    Reply

    Hello,

    I just realized that Scratchpad doesn’t exist anymore in Firefox 72 + . So how can I run the scripts.

    Thank you.

  5. Shiro said on September 7, 2019 at 3:10 pm
    Reply

    This is the last post on the gHacks user.js script, so in spite of this being almost 2 years old, I’m commenting here.

    I spent a lot of time going over the script, alas not everything is well explained so once you run it and make some mods with e.g. the 12bytes.org overrides (at least some of them) you’re bound to hit some issues.

    Is there a forum where people discuss this script and its features, where I can go and ask for help?

  6. CHEF-KOCH said on October 18, 2018 at 11:11 am
    Reply

    It’s a shame that Ghacks became an bitch fight platform for Pants, it really is. Falöse claims and nothing but this, I even explained it and he still refuses, he seems to be sick to ignore the reality.

    If ghacks still spreads this FUD I might be forced to involve my lawyer now. Pants is not ghacks and it’s beyond me why this user gets so many attention, maybe because no one would care he uses ghacks as shield but it would be a shame if I have to sue Martin because of actions from his community.

  7. Friendly GitMan said on January 13, 2018 at 8:37 pm
    Reply

    @ Pants

    About PLAGIARIZE accusations:

    What’s the license of the allegedly plagiarized code? And the license of the allegedly copied (forked) code?
    C’mon, it’s a modified copy and everyone involved should come to friendly terms about it.

    >A concerned gitman
    (Not the guy who worked @ Nvidia & M$)

    1. Pants said on January 14, 2018 at 3:56 am
      Reply

      The ghacks user.js is under a MIT license: https://github.com/ghacksuserjs/ghacks-user.js/blob/master/LICENSE.txt (set Feb 17th 2017)

      “without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.”

      CHEF-KOCH’s “copy”, AFAIK, has not adhered to this license. His is set as GNU (https://github.com/CHEF-KOCH/Firefox-prefs.js-cleaner/blob/master/LICENSE )

      I am not incensed by anyone using it, modifying it, etc. It’s free, just adhere to the license.

      It is disgusting to me at least, that someone will claim they wrote it and offer no actual proof (because they can’t) – despite my links/evidence. And it’s appalling that someone else’s work (it was not mine) is being marginalized. None of us are seeking any reward – hell, we all use anonymous handles etc – but it goes against the spirit to RIP SHIT OFF and PASS IT OFF AS YOUR OWN – that’s just downright despicable and low. And I will stand up for claustromaniac (and earthlng, both of whom couldn’t care less), and I will denounce CHEF-KOCH for the needless jerk move and lies – especially since he likes to impart his own wisdom here at ghacks. I think we all deserve to know the truth and who we’re dealing with, that’s all.

      > just look at both, practically the same

      He couldn’t even center his name as author in the ascii box

      > The plagiarizer implicitly admitted when he did not disagree on similarity but rather on precedence, stating his work was the first, without any evidence

      Because he can’t produce any evidence, because he did not write it – he copied it.

    2. Tom Hawack said on January 13, 2018 at 10:58 pm
      Reply

      Plagiarizing is not limited to legal/copyright issues. When you’ve worked hard to offer a tool and that someone who hasn’t worked copies your hours of efforts and then presents it as his labor, I believe anyone would get at least irritated.

      Of course the work here is not in the scope of creation but in that of seeking settings which potentially hold privacy and security issues and then organizing them, with moreover references to sources and explanations. Settings are owned by no one, it’t not them which are plagiarized but the final copy : just look at both, practically the same. The plagiarizer implicitly admitted when he did not disagree on similarity but rather on precedence, stating his work was the first, without ant evidence by the way, only a vague reference to a Reddit thread, free of an url : where?

      So, the problem is not legal, it’s only a matter of fairness. That’s all and that’s enough to irritate anyone. Pants got irritated, I understand that, I agree with him saying so, and I believe all of us do.

  8. Alma said on January 12, 2018 at 9:32 am
    Reply

    Hello. Can I use user.js in PaleMoon Browser since it’s based on mozilla code ? Thank you.

    1. IT Bearded Guy said on January 13, 2018 at 8:50 pm
      Reply

      98% Yes.

      2% Some possible errors may appear on Console, due to the fact that Firefox about:config and Palemoon about:config aren’t the same.

      I did on an old Palemoon and nothing broke. As the github wiki explains well, you can try it on a new profile with no thrills.

  9. miki said on January 10, 2018 at 12:47 pm
    Reply

    NOT WORK FOR ME (ESR):

    Current user.js file backed up.

    Retrieving latest user.js file from github repository…

    Update failed. Make sure PowerShell is allowed internet access.

    1. IT Bearded Guy said on January 13, 2018 at 8:47 pm
      Reply

      Your PC has either an AV that blocks scripts to download from the net
      Or your System Administrator has hardened your OS to do the same

  10. Anonymous said on January 10, 2018 at 12:05 am
    Reply

    Is there a way to disable the moving underline that happens when hovering over an URL on a page?

    For example, on this page hovering over the first line in this article, The Ghacks user.js, https://github.com/ghacksuserjs/ghacks-user.js, turns the already underlined link into a gold/yellow moving underline. Is that something that can be changed with a browser setting?

    1. Featured Singer said on January 13, 2018 at 8:45 pm
      Reply

      That’s a FEATURE of the newly improved ghacks.net site! Ask Martin!

  11. Adrian said on December 30, 2017 at 6:14 pm
    Reply

    Configfox haven’t been updated in a long time. But still 100x better that this console window.

  12. listquestion said on December 30, 2017 at 4:35 pm
    Reply

    Is there a way to find the list here on this website ? I certainly would like to use some of the settings but not sure if I need or want all of them or in automated form. Wouldn’t it be an idea to provide (if not already happened) the list here as text and update it so interested user could pick from it what they like ?

    Just an idea, happy New Year to everybody.

    1. Profitable Woman said on January 13, 2018 at 8:43 pm
      Reply

      Go to the github page and scroll down, find:

      USER.JS

      Click on it

      ?

      Profit

  13. Arnauld said on December 29, 2017 at 11:29 pm
    Reply

    when runing the updater on Linux, I have this :

    bash updater.sh
    updater.sh: line 7: syntax error near unexpected token `newline’
    updater.sh: line 7: `’

    1. Pants said on December 29, 2017 at 11:35 pm
      Reply

      I’ve passed the info on to the code monkeys – https://github.com/ghacksuserjs/ghacks-user.js/issues/325

      @Martin .. where did my comments in here go, two of them from hours ago :)

      1. Martin Brinkmann said on December 30, 2017 at 8:20 am
        Reply

        They are visible now, sorry for that!

  14. Arnauld said on December 29, 2017 at 10:10 pm
    Reply

    well, and how to run these in Ubuntu ? :-)

  15. Dave said on December 29, 2017 at 8:49 pm
    Reply

    A lot of time spent undoing what Mozilla decided was best for us, against our wishes :(

    I wish someone would just create a browser that only showed what I wanted instead of downloading tons of unwanted crap in the background :(

    1. Anonymous said on December 30, 2017 at 4:32 pm
      Reply

      You really don’t need a thousand about:config changes to get what you want though. Just because you can doesn’t mean you have to.

      Disable telemetry from about:preferences#privacy-reports and you’re mostly done. You can then review https://www.mozilla.org/privacy/firefox/ and https://support.mozilla.org/en-US/kb/how-stop-firefox-making-automatic-connections and make further decisions for things like Safebrowsing, auto-updates, OCSP (keep all of these on).

      Regarding web standard related preferences, again only a handful make any sense, especially now that fingerprinting resistance is implemented. (Actually, too much customisation that can be detected from websites and servers can be harmful for privacy)

    2. Tom Hawack said on December 29, 2017 at 11:14 pm
      Reply

      I guess we all have that wish which poses the idea of a common denominator of what settings would appear so universal that they’d meet everyone’s expectations. Besides this point remains the fact of diversity in less universal factors but nevertheless important, sometimes crucial features, and if diversity enriches mankind it doesn’t always please the man.

      But I think what is specific of a certain concept of leading a business is this very smart understanding of human nature, mainly articulated around two main factors :
      1- A two-way so called “50/50” approach of the transaction, in that there is no slavery given the fact exchange is the master word : one brings services, browser features which are always legitimate because they bring a plus in terms of speed and functionalities but profitable because their hidden cost is the user’s privacy. Basic example is the one of cookies, vector of easiness for the user, of data collection for the issuer. If you look at it closely you cannot find one privacy related feature which doesn’t present the argument of efficiency (hence benefit for the user) as a counterpoint.
      2- Many of us users forget their aspirations and principles when the temptation is sufficiently well crafted to make that temptation appear less as apposed to our principles than as perfectly posed in our idea of comfort. As with money it’s only a problem of the number of zeros after the leading digit, according to a wide business state of mind, which means that if the service, if the feature is close enough to excellency than it is able to defeat the strongest principles. I don’t think this is true as a global law because I remain confident that there are and always will be users remaining faithful to their dignity. But how many? And how many others entertain the flexibility of their principles on what they conceive are those of the others, of the society, participating as such in a rolling snwoball getting thicker every day. I wouldn’t be surprised that today’s concerns of privacy be nothing but a laugh within 5, 10 years. Security will remain a top priority, but not sure privacy will. There’s a word to define the abandon of dignity when faced to the attractiveness of venality. Yep.

  16. Pants said on December 29, 2017 at 5:17 pm
    Reply

    Feel free to use CHEF-KOCH’s ripoff version that he claims he wrote himself
    https://github.com/ghacksuserjs/ghacks-user.js/issues/323#issuecomment-354376689

    1. CHEF-KOCH said on December 30, 2017 at 11:10 am
      Reply

      I wrote the script 8 days before ‘yours’ on reddit, fun isn’t it.

      1. Pants said on January 2, 2018 at 2:58 am
        Reply

        @Anonymous

        Last release was 57 – I just did a 57 final and moved to 58 beta, about an hour ago. But that doesn’t really mean anything – the master copy is always being worked on. I can’t release a 58 until 58 stable lands, but we’re always looking ahead and have diffs ready (thanks to earthlng)

        https://github.com/ghacksuserjs/ghacks-user.js/issues?q=is%3Aissue+label%3Adiffs – the 57->58 diffs have been up for a while now for those interested. We’ll work our way thru them in the next 3 weeks

      2. Anonymous said on January 1, 2018 at 6:57 pm
        Reply

        @pants, v56 > last release from you v58: I bet a lot of users running Firefox stable must be impatient for the updated version :-), and for the lite version too?.. especially if they see you wasting your time trying to influence CHEF-KOCH THE GREAT (IN UPPERCASE).

        Happy new year Pants :-)

      3. Tom Hawack said on December 30, 2017 at 3:31 pm
        Reply

        @CHEF-KOCH, why do you do that, why do you plagiarize? There’s a lot of commitment, work and deserved fame for the developers of ghacks-userjs, why do you copy the original and then paste it and propose it as your work? Why? You don’t need that to be recognized as a talent of your own. I’m really stunned, and I’m certainly not the only one. This is not acceptable, you have to respect people.

      4. Pants said on December 30, 2017 at 12:09 pm
        Reply

        https://github.com/ghacksuserjs/ghacks-user.js/pull/311 – the first PR by claustromaniac 18 days ago, and that was after a week of talking about it and sample scripts

        https://github.com/ghacksuserjs/ghacks-user.js/commit/fbd9f344af3cb6d0fb320de57497278887cc4b83 – v1.0 commit 15 days ago

        https://github.com/CHEF-KOCH/Firefox-prefs.js-cleaner/commit/1f77f541bdd5cfbda52eecf9c7d3435c771fe4a9 – your version committed 14 days ago. Except for a few word changes such as the author, it’s IDENTICAL

        I call BS. This is not the first time you’ve been caught passing off other people’s hard work as your own. Where is this reddit link that predates claustromaniac’s work? I can show you the changes and discussions that claustromaniac and earthlng had and how the script changed to its final version. Yours is a single commit and IDENTICAL .. come on, where’s your proof

      5. CHEF-KOCH said on January 9, 2018 at 4:29 pm
        Reply

        Dunno what you don’t get if I say ‘8 days before yours on reddit’. I guess that’s already as easiest as possible explained but you didn’t got it.

        If you do a complaint ensure you checked all resources. This just only shows you have a ego problem, a serious one, no one cares and no one gives any fuck because it’s open source and it’s not even licensed because there is no license for batch strings like copy something on another place, ascii ‘art’ in a ‘readme or header’ something like this. If you want the specific name, go ahead take it I don’t even care cause from the law point both of us didn’t ask Mozilla to use the name for it (I’m just collecting the facts here).

        Your Github thread claims I stole some work which is (still) incorrect and nor did I stole something ‘again’, remember that ghacks-user.js .. or should I say your ‘own property’? is based on my and 23bytes.org work, so come down you did not invented the wheel, you just another guy which wants attention.

        You blocked me on GitHub now you make a scene here on GitHub, I was forced to create an seperate thread because of your block instead of facing me, I won’t abuse Martins Blog here for such garbage fights and I’m also not here to correct your user.js, your stuff on GitHub or here on his Blog.

  17. Anonymous said on December 29, 2017 at 5:16 pm
    Reply

    I would have certainly tried if:

    – Prerequisites (“disable the Internet connection”) did not look like a disinfection after catching a virus.
    – On my machine I had blocked everything that comes close to a script.
    – If I did not use a browser that already respected privacy by default.

  18. Cloudman said on December 29, 2017 at 3:45 pm
    Reply

    I’ve written my changes to user.js in a mozilla.cfg file, using lockPref.

    1. Pants said on December 30, 2017 at 9:23 am
      Reply

      That’s an idea. But then you they’re locked and you can’t toggle them for testing/troubleshooting, and they will also apply to all profiles (right?) – so its not very flexible, but certainly doable depending on your needs.

      I also read a few times that some prefs (no idea what the sources are now) cannot be set from cfg – have you come across any, out of interest?

      1. Cloudman said on December 31, 2017 at 3:23 am
        Reply

        I made just five changes to user.js, and only to lock default settings of Firefox — no need to troubleshoot (but to do it, I would just need another file to save what I remove).

        And you’re right, it would apply to all profiles, but I only have one.

        I indeed came across some preferences that I couldn’t lock: full-screen-api.transition-duration.enter and full-screen-api.transition-duration.leave for example. Also, I’ve been exploring Linux distros, and I’ve noticed some pref can be locked in Windows but not Linux.

  19. Tom Hawack said on December 29, 2017 at 2:20 pm
    Reply

    I’m cautious with anything to do with automation when it concerns a computer. As much as I admire and use gHacks-userjs, intensively, as much I don’t and won’t use these automation tools. In fact I build my own user.js on the basis of the ghacks-userjs one, free of the most valuable comments in order to have a condensed file with quick visual access to settings, but keeping the settings’ groups’ numbers. Of course this requires a following of the changes (new, removed) but as well implies knowing what *each* settings corresponds to. Big changes (new Firefox version) are granted by a few hours of my spare time, and worth it. Of course if I hadn’t the time I’d conceive and manage user.js differently and then automation would be and necessary and welcomed. It’s always a time problematic.

    1. Magical Combo said on December 29, 2017 at 7:24 pm
      Reply

      Keep a backup and you have zero problems coming from scripts.

  20. bufferer said on December 29, 2017 at 12:35 pm
    Reply

    user.js is easy enough. All this is very confusing; f*******ck mee.

    1. Magical Combo said on December 29, 2017 at 7:23 pm
      Reply

      It’s three steps that even someone in primary schools can apply.

    2. Glumph said on December 29, 2017 at 3:27 pm
      Reply

      For me it is confusing, too. But if you are in need of a good f******* please look somewhere else, you may even have to pay for it.

      1. Tom Hawack said on December 29, 2017 at 5:06 pm
        Reply

        No one is discrediting gHacks-userjs, only wondering on the pertinence of automated tools to keep it updated.

    3. Player 1 said on December 29, 2017 at 1:46 pm
      Reply

      +1.

  21. Gary D said on December 29, 2017 at 10:05 am
    Reply

    Season’s greetings Martin :)

    This will make updating user.js a lot faster. I have a question.
    I am using FF 52.5.3. Will i be able to use the automated script clean up on 52.5.3 without any problems ?
    Thanks in advance.

    1. Magical Combo said on December 29, 2017 at 7:21 pm
      Reply

      Sure.

    2. Pants said on December 29, 2017 at 5:26 pm
      Reply

      Hi Gary D :)

      Read the Updater Script reference ( https://github.com/ghacksuserjs/ghacks-user.js/wiki/3.3-Updater-Scripts ).

      As long as you have the user.js same as ghacks master, keep your changes/overrides in a user-overrides.js file, and append them to the end of the user.js, then all is well. The update script simply backs up your user.js, grabs the
      latest one off github, and appends your user-overrides.js to the end.

      That’s all it automates – the rest you would do as per normal (eg see https://github.com/ghacksuserjs/ghacks-user.js/wiki/3.2-Applying-Your-Changes#small_orange_diamond-caveats )

      *** For you on ESR, you would need to change that one-char switch in the deprecated ESR section. The other one-char switch section is the RFP Alternatives section (if you don’t want to use privacy.resistFingerprinting). That caveat list covers it all.

      1. Pants said on December 30, 2017 at 12:11 pm
        Reply

        @Gary D .. definitely going to be having a few beersies :) HNY to everyone as well, except CHEF-KOCH who plagiarizes

      2. Gary D said on December 30, 2017 at 10:26 am
        Reply

        @ Pants

        Thanks for the reply and the links / tips. Enjoy the rest of the holidays, especially New Year;s Eve ! ;)

Leave a Reply

Check the box to consent to your data being stored in line with the guidelines set out in our privacy policy

We love comments and welcome thoughtful and civilized discussion. Rudeness and personal attacks will not be tolerated. Please stay on-topic.
Please note that your comment may not appear immediately after you post it.