/disable-private-browsing-in-firefox

Disable private browsing (incognito mode) permanently in Firefox (Ubuntu 20.04)

How to permanently disable private browsing in Firefox

Disable private browsing (incognito mode) permanently in Firefox (Ubuntu 20.04)

I learned this here with @mkaply.

Follow the recipe:

    1. In terminal, go to: /usr/lib/firefox/distribution

Obs.: This is the correct directory if you are using Firefox version 91.0 and Ubuntu 20.04. Depending on the Firefox version and/or OS this might be different.

    1. If there is no policies.json file, then create one:
 $ sudo touch policies.json
    1. The file's content needs to be:
{
  "policies": {
    "DisablePrivateBrowsing": true
  }
}
    1. If you are facing problems with "read-only", invoke your favorite editor using sudo, such as:
$ sudo emacs policies.json 
$ sudo vim policies.json 
$ sudo gedit policies.json 
    1. Re-start firefox and try using Control-Shift-P. Hopefully, it won't work.