Home » Internet » How to Disable Incognito Mode in Windows, Ubuntu and macOS

How to Disable Incognito Mode in Windows, Ubuntu and macOS

by Pratik
0 comment

It’s always dicey to have Incognito mode on your browsers when you have kids around. Either you switch to parental control but not all the browsers and operating system support Parental Control. Hence, your only option is to block the Incognito mode altogether. So, here is how to disable Incognito mode in Windows, Ubuntu, macOS, and Android.

The method to disable Incognito Mode is more of OS-specific rather than browser-specific. We would start off with Windows and just in case you are using Ubuntu, skip to this portion and for macOS, head over to this portion. All of these methods require you to have root or Administrator access.

Also Read: How to block NSFW content on Android & Windows.

How to Disable Incognito Mode

1. Windows

For Windows, we are considering 2 popular browsers: Mozilla Firefox and Google Chrome. In Windows, the easiest way to disable the Incognito mode is via the Windows command line. For that, launch the command prompt with administrator privileges

command-prompt-as-administrator

To disable Incognito Mode on Chrome browser, type the following command in the cmd and hit Enter.

REG ADD HKLM\SOFTWARE\Policies\Google\Chrome /v IncognitoModeAvailability /t REG_DWORD /d 1

disable-incognito-command

For Mozilla Firefox, use the following command instead.

REG ADD HKLM\SOFTWARE\Policies\Mozilla\Firefox /v DisablePrivateBrowsing /t REG_DWORD /d 1

disable-private-mode-mozilla-firefox-command

Restart the brower and upon the next launch, the Incognito mode will be disabled for you. To enable the Incognito mode back again, use the following command for Google Chrome and Mozilla Firefox respectively.

Google Chrome:

REG DELETE HKLM\SOFTWARE\Policies\Google\Chrome /v IncognitoModeAvailability /f

Mozilla Firefox:

REG DELETE HKLM\SOFTWARE\Policies\Mozilla\Firefox /v DisablePrivateBrowsing /f

2. Ubuntu

For Ubuntu, we are considering the 2 most popular browsers: Mozilla Firefox and Google Chrome. The quickest way to do disable Private/Incognito mode on Ubuntu is via the Terminal. We will start off with Google Chrome.

Google Chrome:

Open the terminal and navigate to the following folder “/etc/opt/” using the below-mentioned command.

cd /etc/opt/

cd-etc-opt

We need to create multiple directories here, so use the following command to create and navigate to the newly created directory.

sudo mkdir -p chrome/policies/managed && cd /etc/chrome/policies/managed

For Chromium, the directory location to be created is “/etc/chromium/policies/managed”

sudo-mkdir-chrome-policy-folder

Read: A Simple Trick to Bypass Google reCaptcha in Chrome’s Incognito

Next, we need to create a JSON policies file and add few lines to disable Incognito mode. To do that, use the following command.

vi chrome_policy.json

edit-policy-file

Now, inside the vi editor, enter the following lines.

{
       "IncognitoModeAvailability": 1
}

After you have done that, press “:” followed by “wq” to save the changes in the file.

disable-incognito-google-chrome

Launch Google Chrome now and the Incognito mode option will be disabled. To enable it back again, modify the text in the JSON file as follows.

{
     "IncognitoModeAvailability": 0
}

Mozilla Firefox:

The method to disable Private mode in Mozilla Firefox is similar to the one mentioned above with a few changes in the text and directory location. Firstly navigate to “/usr/lib/firefox/distribution” by using the following command.

cd /usr/lib/firefox/distribution

cd-to-file-directory

At this location, we need to create a JSON file and add few lines to it. To do that, run the following command.

sudo vi policies.json

Now, add the following lines of code in the file.

The file name has to be exactly policies.json.

{
  "policies": {
    "DisablePrivateBrowsing": true
  }
}

After entering the lines, press “:” and wq to save and exit the JSON file.

Restart Firefox and you will still be able to see the private window option. However, if you try to launch the private mode, you will be greeted with the following error.

blocked-private-mode-error

From here on, whatever you search in this window will be recorded in the Browser history. To enable Private Browsing back again, remove the lines of code we added above from the policies.json file.

3. macOS

For macOS, disabling Incognito mode is pretty simple if you are dealing with Google Chrome but quite tricky with the native Safari app. Firstly, let’s see how to do it in Google Chrome.

Google Chrome:

To disable the Incognito mode we need to run a command and for that we need the terminal. To launch the terminal, press command + spacebar to launch Spotlight search. Type “Terminal” in the search bar and then double-click on the first search result.

spotlight-search-terminal

On the Terminal type the following command. This command will change the system policy and disable Incognito Mode.

defaults write com.google.chrome IncognitoModeAvailability -integer 1

disable-incognito-chrome-command

Now, restart Google Chrome and post that you will see that the option to launch Incognito mode is invisible.

incognito-disabled-in-chrome

Safari:

Now, to disable Private Browsing mode for Safari, the only method is to modify the interface of Safari which involves editing the “nib” file. For that, we would need to download XCode and a nib file editor from GitHub. This change is irreversible unless you take a backup of the “MainMenu.nib” file.

There are high chances that you might break the code of Safari and hence I wouldn’t recommend going down this line. The best you can do is enable Parental Controls on Safari which inherently blocks adult websites.

4. Android

In Android, you would need a paid tool called Incoquito($1) to block Incognito mode in Google Chrome or any Chromium-based browsers. We have a dedicated article on how to disable incognito mode in Google Chrome for Android, you can read it for a detailed guide on the topic.

Closing Words

These methods work best to block Incognito across a local network or on your same PC. To learn more about website-based blocking and DNS, check out our articles on how to block a website or how to switch to a public DNS server.

For any queries or issues, let me know in the comments below and I will get back to you.

Also Read: How to Disable Incognito Mode in Google Chrome for Android

You may also like

Leave a Comment