30

I use this extension called Website Blocker to discourage me from checking Gmail/Reddit. However, it is easy and tempting to open a New Incognito Window; since extensions are disabled in Incognito Mode, I'm still able to browse Gmail/Reddit while in Incognito.

Is there any way to disable Chrome's Incognito Mode in Ubuntu? Ideally, this would encourage me to use my smartphone as a dedicated Gmail/Reddit checker.

1

3 Answers 3

35
+50

To disable incognito on chrome/chromium you need to edit the policies. Doing this will prevent you from opening an incognito window via Ctrl+Shift+n, and will also grey out the incognito window option in the options tab in the corner.

If you're using chrome, create the folder /etc/opt/chrome/policies/managed. Or if you're using chromium, create the folder /etc/chromium/policies/managed.

Then create a file in that directory named test_policy.json. It can have any name you want, but it needs the extension to be .json.

Open it in your favorite editor and put:

{
    "IncognitoModeAvailability": 1
}

That should do it!

Source: http://www.chromium.org/administrators/linux-quick-start and http://www.chromium.org/administrators/policy-list-3

7
  • 2
    Still works on Chromium version 45.0.2454.101 Ubuntu 15.04 (64-bit). Nov 2, 2015 at 18:04
  • 2
    Tip: use mkdir -p /etc/opt/chrome/policies/managed, then cd to the same and create the file. You don't even need to reload chrome for it to take effect it seems!
    – Eloff
    Dec 31, 2015 at 0:09
  • 2
    this does not seem to be working anymore, can anybody else report? Apr 14, 2016 at 13:23
  • 2
    this works for Ubuntu 18.04 LTS, and now not even shortcut of Incognito works, and Incognito option in option-menu is invisible now. Thanks, Pomsky and Ryan. Jul 14, 2019 at 12:37
  • 2
    It's working for me on Debian 8 Chrome 75. Thanks a lot.
    – Baha
    Sep 25, 2019 at 12:52
7

This doesn't directly answer your question, but rather than disabling incognito mode, you can instead enable the extension in incognito mode windows:

  1. Click the spanner icon and then pick Tools -> Extensions from the menu.
  2. Next to the extension you're interested in, click the expander arrow.
  3. Check the "Allow in incognito" check box that is revealed.

Now the extension will be active in future incognito mode windows you open.

The caveat is that if the extension stores any information about your browsing history, your incognito browsing habits may not be as private as before. If the extension simply blocks certain URLs from loading though, this might not be a concern.

3
  • 1
    Beat me to it :P Jason, use James' answer when you select an answer. He was here first :) @James, can I delete an answer without losing reputation? I don't want to have duplicate answers here clogging the page. Mar 27, 2012 at 4:08
  • I can't see why deleting an answer would lose you any reputation. Punishing a user for tidying up their own content sounds like the opposite of how this site runs. Mar 27, 2012 at 5:16
  • Deleted it with no loss; thanks for your input. Mar 27, 2012 at 5:42
1

In Ubuntu 22.04 LTS, using Chromium, the top-voted answer didn't work. Instead, putting test_policy.json in /etc/chromium-browser/policies/managed did the trick for me.

I think this change was already in effect for 20.04 LTS, but if someone could find a source for these changes that would be great.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.