[Android Chromium] Force Incognito Mode

298 views
Skip to first unread message

Victor Blaess

unread,
Aug 5, 2020, 1:14:20 PM8/5/20
to Chromium-dev
Dear All,

I would like to customize the Android Chromium Project, so Incognito Mode is the only way to use the browser.
  • Browser Startup by default in incognito mode
  • New Tabs are always starting in incognito mode.
Could you tell me which files I need to maintain.
Started first tests with the ServiceTabLauncher.java.
Unfortunatly that did not work.

I am thankful for any advice! :)
Thank you very much!a

Drew Wilson

unread,
Aug 6, 2020, 5:20:32 AM8/6/20
to victor...@gmail.com, Chromium-dev
Have you taken a look at https://cloud.google.com/docs/chrome-enterprise/policies/?policy=IncognitoModeAvailability? Probably the easiest way to achieve what you want is to leverage the policy mechanism to force IncognitoModeAvailability=2. You could (in theory) do this even without modifying the Chrome codebase, but if you search for IncognitoModeAvailability you can probably find ways to hardcode that policy setting if that's what you want.

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/8ab7ba66-6fed-46b3-b882-6f6b4592e434n%40chromium.org.

Ramin Halavati

unread,
Aug 6, 2020, 7:31:20 AM8/6/20
to atwi...@chromium.org, victor...@gmail.com, Chromium-dev
IncognitoModeAvailability=2 (forced) is not supported on Android.
You may need to follow the code path and implement it similar to the way it runs on Desktop.
Also note that if you add such a limit, you should also somehow handle CCTs.

If you really don't need a limited compiled version of Chromium, you can consider creating a shortcut to incognito instead.
image.png

Victor Blaess

unread,
Aug 6, 2020, 7:33:25 AM8/6/20
to Chromium-dev, Drew Wilson, Chromium-dev, Victor Blaess
Dear Drew,

thank you for the fast reply!
I have gone through the code and had a look on every occurence.
It still seems a bit complicated to hardcode it, because I couldnt find a simple entry point to set it.
Nevertheless the build is running right now, to do some first tests with the changes I did.
If you have any further advises on that topic, please let me know :)

Thank you very much. Really appreciating your support.

Victor Blaess

unread,
Aug 6, 2020, 8:03:16 AM8/6/20
to Chromium-dev, Ramin Halavati, Victor Blaess, Chromium-dev, Drew Wilson
Dear Ramin,

thank you for yout support.
In my case, I need to force the user to use incognito mode and the user should not have a possiblity to go out of incognito.
We also thought about that solution but the software is deployed via a software distribution tool, which also does not support custom startup parameters like "-incognito" on Desktop.

Ramin Halavati

unread,
Aug 6, 2020, 8:24:53 AM8/6/20
to Victor Blaess, Chromium-dev, Drew Wilson
There is a bug filed for this issue (1029798). It's not high up the priority list, so I think you cannot expect it to be implemented in the foreseeable future. But you can mention your use case there.

Victor Blaess

unread,
Aug 6, 2020, 1:24:04 PM8/6/20
to Chromium-dev, Ramin Halavati, Chromium-dev, Drew Wilson, Victor Blaess
Dear Drew, Dear Ramin,

as Ramin said, unfortunatly that didnt work on Android.
Any other ideas :) ?

@Ramin I could not open the link. I got permission denied. :( 

Ramin Halavati

unread,
Aug 11, 2020, 3:01:35 AM8/11/20
to Victor Blaess, Chromium-dev, Drew Wilson
Hi Victor,

The bug is open now (issue 1029798).

Victor Blaess

unread,
Aug 13, 2020, 11:28:00 AM8/13/20
to Chromium-dev, Ramin Halavati, Chromium-dev, Drew Wilson, Victor Blaess
Hey Ramin,

thanks for the update.
We have a similiar case.
The devices are shared across employees and we do not want the devices to safe any kind of information that the user has produced on the device (cookies, browser history, passwords etc.)
Creating a shortcurt does not work for us as the apk is deployed via software distribution (we thought about that workaround for sure !)
Do you have any other idea how I can enable the required functionalities ?
I guess the most of these would be handled by just forcing the user to use the browser in incognito mode.

Ramin Halavati

unread,
Aug 17, 2020, 3:03:32 AM8/17/20
to Victor Blaess, Chromium-dev, Drew Wilson
Unfortunately I don't have any other suggestions.
Reply all
Reply to author
Forward
0 new messages