Custom Tabs

Also known as: Chrome Custom Tabs

On this page 7

Custom Tabs is an Android mechanism that lets a native app open a web page inside the user’s default browser, presented as a lightweight overlay that carries the app’s color and actions while the browser keeps control of rendering, cookies and security. In mobile web practice, Custom Tabs, often called Chrome Custom Tabs after the browser that introduced the feature in 2015, sit between launching a full external browser and embedding a WebView inside the app.

The design solves a long-standing dilemma for app developers: an external browser breaks the user flow, while an embedded WebView isolates the page from saved logins, autofill and cookies. Custom Tabs keep the flow inside the app and still give the page the browser’s complete state, which is why they are the recommended default for linking to third-party content on Android.

How Custom Tabs hand a page to the browser

A Custom Tab is a browser activity launched by intent, not a view rendered by the host app. The app builds an intent through the AndroidX Browser library, sets visual options such as toolbar color and close button, and asks the browser to open a URL. The browser then draws the page in its own process, with its own sandbox, cookie jar and password manager.

Because the browser owns the page, the host app cannot read or inject into the content. It cannot run JavaScript in the page, read cookies or inspect form fields. That boundary is the core security property: a user signing in through a Custom Tab enters credentials into the browser, not into the app that requested the page.

Custom Tabs also support warm-up and prefetching. The app can bind to a CustomTabsService, call warmup() to start the browser process early and call mayLaunchUrl() to hint at a likely destination. On a typical mid-range phone, these hints can cut perceived opening time by several hundred milliseconds, although the browser may ignore them under memory pressure or data-saver settings.

The following table summarizes the main components involved when an app opens a Custom Tab.

ComponentRoleOwned by
CustomTabsIntentDescribes the URL and visual optionsHost app
CustomTabsServiceAccepts warm-up and prefetch hintsBrowser
CustomTabsSessionLinks callbacks and navigation events to the appShared
Rendering engineLoads, sandboxes and draws the pageBrowser
Cookie and credential storeKeeps logins, autofill and site dataBrowser
Components of a Custom Tabs session

Customization options and their limits

Custom Tabs allow branding without ownership of the page. The app can adjust the frame around the content, but the browser decides what the page looks like and always shows the URL or origin in the toolbar, which helps users detect phishing.

The options below are commonly available in current versions of the AndroidX Browser library; support depends on the browser version installed on the device.

SettingWhat it changesPractical note
Toolbar color schemeColor of the top bar in light and dark modeMatch the app theme for continuity
Close button iconIcon that returns the user to the appA back arrow suits flows that feel nested
Action buttonOne custom icon in the toolbarUseful for share or bookmark actions
Menu itemsExtra entries in the overflow menuKeep the list short
Enter and exit animationsTransition between app and tabSlide animations feel native
Partial height tabBottom sheet instead of full screenRequires a recent browser version
Common Custom Tabs settings

The partial Custom Tab, introduced in Chrome around 2022, opens the page in a resizable bottom sheet so the app remains visible above it. It suits short tasks such as reading a policy or confirming a payment, but not every browser supports it, so the code must handle a fallback to the full-screen tab.

Custom Tabs are one of several ways an app can display web content, and the right choice depends on who owns the content and who needs control. The neighboring options are the WebView, the Trusted Web Activity, the external browser and, on iOS, SFSafariViewController.

OptionShares browser stateApp can modify pageBest suited for
Custom TabsYesNoThird-party links and sign-in
WebViewNoYesApp-owned content tightly integrated with native code
Trusted Web ActivityYesNoFull-screen Progressive Web Apps verified by domain
External browserYesNoContent the user wants to keep in the browser
SFSafariViewControllerPartlyNoThe iOS counterpart for third-party links
Ways to show web content from a native app

A Trusted Web Activity is technically built on the Custom Tabs protocol but hides the browser toolbar entirely. It requires Digital Asset Links verification, proving that the app and the website share an owner. Ordinary Custom Tabs need no verification because the visible URL bar keeps the user informed.

Custom Tabs also differ from the generic in-app browser that many social apps build on WebView. Those in-app browsers can inject scripts and track activity, which raises privacy concerns, whereas Custom Tabs keep the page isolated from the host app by design.

When to choose Custom Tabs

Custom Tabs are the default choice for OAuth and single sign-on on Android. Current guidance for native apps, including the OAuth 2.0 best practice for native apps (RFC 8252), recommends an external user agent such as a Custom Tab rather than an embedded WebView, because the app must never see the user’s password.

The decision table below maps common scenarios to a recommended approach.

ScenarioRecommended optionReason
Sign-in with an identity providerCustom TabsCredentials stay in the browser
Opening a news article linkCustom TabsFast, familiar and keeps the user in the app
Help pages bundled with the appWebViewContent needs native bridges and offline storage
Shipping a PWA in the Play StoreTrusted Web ActivityFull-screen display with verified ownership
No compatible browser installedExternal browser or WebViewCustom Tabs cannot launch
Choosing a web content approach on Android

Limitations and common mistakes

Custom Tabs depend on the browser installed on the device. Chrome, Firefox, Samsung Internet, Edge and several other browsers implement the protocol, but the depth of support varies, and some features exist only in recent Chrome releases. Developers should always check for a supporting package before launching.

  • Assuming Chrome is present: on devices without Google services the default browser may lack support, so a fallback is mandatory.
  • Expecting page control: apps cannot read results from the page except through redirects to a registered app link or custom scheme.
  • Skipping warm-up: launching without warmup() wastes an easy latency gain on cold starts.
  • Overloading the toolbar: too many menu items make the tab feel cluttered and confuse users about which app they are in.
  • Ignoring Android 11 package visibility: since Android 11, apps must declare queries in the manifest to detect browsers that support Custom Tabs.

In simple terms

Custom Tabs let an Android app open a web page without sending you away and without building its own small browser. The page opens inside your real browser, but it looks like part of the app, with the app’s colors at the top.

Think of it as a guest window: the app opens the window for you, but the browser runs everything behind it. Your saved passwords and logins still work, and the app cannot see what you type on the page.

A practical example

A regional bank’s Android app lets customers link an external investment account through the provider’s web sign-in page. The first version used an embedded WebView, and support staff saw frequent complaints: customers had to retype passwords, password managers did not fill the form, and a security review flagged that the app could technically capture credentials.

The team switched the flow to Custom Tabs. The app calls warmup() when the user opens the linking screen, hints the sign-in URL with mayLaunchUrl(), and opens the tab with the bank’s toolbar color. After sign-in, the provider redirects to a verified app link that returns the user to the app with an authorization code.

The result was a simpler and safer sign-in flow: password managers filled the form, users already signed in to the provider skipped the login step entirely, and the security review closed because credentials never passed through the app.