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
To disable Incognito Mode on Chrome browser, type the following command in the cmd and hit Enter.
For Mozilla Firefox, use the following command instead.
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: Mozilla Firefox:
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.
We need to create multiple directories here, so use the following command to create and navigate to the newly created directory.
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.
Now, inside the vi editor, enter the following lines. After you have done that, press “:” followed by “wq” to save the changes in the file.
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. 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.
At this location, we need to create a JSON file and add few lines to it. To do that, run the following command. Now, add the following lines of code in the file. The file name has to be exactly policies.json. 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.
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.
On the Terminal type the following command. This command will change the system policy and disable Incognito Mode.
Now, restart Google Chrome and post that you will see that the option to launch Incognito mode is invisible.
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