Wednesday, November 1, 2023

Disable Firefox Auto-Update on Linux

 

Firefox disables the GUI for certain advanced options and settings to strike a balance between user control and simplicity. While Firefox aims to be a user-friendly web browser, it also needs to maintain a balance between providing customization options for advanced users and ensuring a smooth, secure, and user-friendly experience for the majority of users. 

Some advanced settings can have unintended and potentially harmful consequences if misconfigured. Disabling them in the GUI (about:preferences) reduces the likelihood of users accidentally changing critical settings. And this falls in minimizing user error. However, Mozilla, the organization behind Firefox, understands that power users and administrators may still need access to these advanced settings. That's why they provide alternative methods like the about:config page and the policies.json configuration file to change these settings. These methods require a bit more technical knowledge and are typically used by more advanced users or system administrators who need fine-grained control over Firefox's behavior.

To disable Firefox's automatic updating entirely from your Linux system follow these steps:

    1. Find the installation directory of Firefox (e.g.; /home/pop/firefox) then create the subdirectory distribution
    1. Create a policies.json file within /home/pop/firefox/distribution path
    2. Edit policies.json by pasting the following lines

    {
      "policies": {
        "DisableAppUpdate": true,
      }
   }

    3. Save the edits and close the file
    4. Open Firefox to check for changes if taken effect by heading to about:preferences


It is clear from the picture how the updates are disabled.
Additionally, you should see "Your browser is being managed by your organization." at the beginning of the preferences as a link; 

clicking it redirects to what is shown in the URL bar about:policies, you can see all policies took place in the previous file policies.json



Please note that disabling automatic updates for Firefox is not recommended, as it can leave your browser vulnerable to security risks. It is important to keep your browser up to date with the latest security patches. 

Furthermore, you can see all available policies (advanced options) under about:policies#documentation; how they are used is documented on the relevant webpage under what is mentioned as policies.json. You might notice, that different system distributions lead to different ways of configuration; for instance, Windows has its registry to modify the relevant options, while MacOS the same task achieved through XML/HTML file.



Another useful scenario is if someone wants to restrict Firefox from being updated beyond patch updates (still be updated with minor updates), one should add the policy within the policies.json file as

{
  "policies": {
    "AppUpdatePin": "120."
  }
}
In my case the latest update as of the time being is displayed using the terminal command /home/pop/firefox --version which shows 120.0a1; 120 is the patch version, while 0a1 is the minor version. So, the string value should always contain the patch version; and end with a dot ".". 

Please do remember multiple options are separated with a semicolon "," as this is a JSON language; so that the previous file should read as whole as;

{
   "policies": {
         "DisableAppUpdate": true,
         "AppUpdatePin": "120."
    }
}




No comments:

Post a Comment

Copilot in Command-Line Interface (CLI)

  Introduction: CoPilot in CLI is an innovative tool powered by GitHub that aims to streamline and enhance the development process for softw...