Some app developers prefer to keep user within the app as much as possible, even when visiting external links. WebView embeds external web content seamlessly in an app activity so that it looks a part of it. However large contents like complete webpages which cannot fit inside app layout require a minimal browser to show them. Some apps have their own in-app browsers. A relatively recent addition is the ability of standalone browsers (including Chrome and Firefox) to show Custom Tabs inside other apps the same way an in-app browser looks.
When you tap a link, app may fire an explicit intent.action.VIEW
to web browser or an implicit intent with URL as data. In latter case if there are more than one apps which can handle the given scheme in URL (e.g. https://
) and a default app isn't selected already, system activity resolver (com.android.internal.app.ResolverActivity
) shows Open With dialogue (with help from package manager which shows last selected app on top (see more details in this answer):
Then an explicit intent is forwarded to user selected app. So here if you select a browser (or other app) which doesn't provide Custom Tabs functionality, full browser is launched. But if the intent is a CustomTabsIntent
(with EXTRAs) and the selected app (e.g. browser) supports Custom Tabs, the URL is opened within the calling app. Browser may start a CustomTabsService
in background to receive intents with ACTION_CUSTOM_TABS_CONNECTION
:
~$ dumpsys package | grep CustomTabsService
android.support.customtabs.action.CustomTabsService:
b5a09c8 org.mozilla.firefox/org.mozilla.gecko.customtabs.GeckoCustomTabsService
Firefox, at least, provides an option in settings to disable Custom Tabs:
Similarly some apps can provide a configuration option to open links externally, disabling in-app browser and/or custom tabs. Or you can customize the custom tabs behavior using third party apps like Lynket - an open source project (I have no affiliation). Theoretically the same approach can be used to disable custom tabs by selecting such app when "Open with" dialog is shown.