Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I start chrome custom tabs in incognito mode?

I am using custom tabs for OAuth and don't want chrome to keep cookies when the login session is over. Google's app-auth library doesn't give any support for that. I thought, maybe opening up the custom tab in incognito mode would help me to solve this problem. Has anyone before run into the same problem. In custom tabs documentation I couldn't find anything helpful

like image 702
eminuluyol Avatar asked Sep 12 '25 16:09

eminuluyol


2 Answers

As described here and introduced here, it's now possible to use custom tabs with incognito mode.

Do so by adding the "com.google.android.apps.chrome.EXTRA_OPEN_NEW_INCOGNITO_TAB" extra to the Intent like so:

CustomTabsIntent.Builder().build()
        .apply {
            if (openNewIncognitoTab) {
                intent.putExtra("com.google.android.apps.chrome.EXTRA_OPEN_NEW_INCOGNITO_TAB", true)
            }
        }

Depending on the Chrome version, users will likely have to manually enable two Chrome flags for this to work:

chrome://flags/#cct-incognito
chrome://flags/#cct-incognito-available-to-third-party
like image 71
Chris Lacy Avatar answered Sep 14 '25 07:09

Chris Lacy


It's not currently possible to start a Custom Tab in incognito mode.

like image 43
andreban Avatar answered Sep 14 '25 08:09

andreban