# WebAPK

> How Chrome on Android mints a signed APK from the manifest, what package identity, intent filters, and splash screen a WebAPK adds, and how updates propagate.

A WebAPK is a small, signed Android package that Chrome generates when a user installs a PWA on Android. It gives the web app a package name, an app-drawer entry, a Settings › Apps entry, and intent filters for its scope, beyond what a Home Screen shortcut provides. Chrome 57 introduced it; Samsung Internet mints its own equivalent; Firefox for Android and WebView install shortcuts only, and no desktop platform uses the model (compat dataset `webapk`).

## How it works

Installation runs through Google's minting service, which is why a WebAPK needs network access at install time:

1. The user accepts the install from `beforeinstallprompt`'s `prompt()`, the mini-infobar, or the menu.
2. Chrome sends the manifest URL, its parsed contents, and icon hashes to the WebAPK server.
3. The server returns an APK signed with its own key, containing only metadata: package name, label, icons, a splash screen, and an intent filter for the manifest `scope`.
4. Chrome installs it through Android's package installer; Android treats it as an app, so it appears in the app drawer and in Settings › Apps and can be uninstalled from either.

If the minting service is unavailable, Chrome creates a plain Home Screen shortcut instead ([web.dev](https://web.dev/learn/pwa/installation)).

A WebAPK gives the app an OS-level identity:

| Behaviour | WebAPK | Home Screen shortcut |
|---|---|---|
| Package name, app drawer, Settings › Apps entry | Yes (package name prefix `org.chromium.webapk`) | No; Home Screen only |
| Links into `scope` opened from other apps | Open in the WebAPK (intent filter) | Open in the browser |
| Splash screen | Built from `name`, `background_color`, and the 512 px icon | None |
| Recents entry | Separate task with the app's name and `theme_color` | Browser task |
| Install twice | Not possible; the existing package is reused | Possible; duplicates share one storage |
| Needs network at install | Yes | No |

The web content is still Chrome: the WebAPK launches `start_url` in a Chrome activity using the user's Chrome profile, so cookies, storage, service workers, and the Chrome version are the browser's. No native API beyond the web platform becomes available, and a Play listing requires a Trusted Web Activity instead.

## Manifest updates

Chrome re-reads the manifest when the installed app is launched and asks the minting server for a new APK when `name`, `short_name`, `icons`, `start_url`, `scope`, `display`, `orientation`, `theme_color`, or `background_color` changed; web.dev's WebAPKs article documents the check as throttled to about once a day and the new APK as installed in the background, so the change shows on a later launch. A changed `start_url` origin or a manifest that no longer parses stops updates rather than breaking the installed app.

## Examples

Manifest fields control the splash screen before page JavaScript runs. Page code can check the install context.

### Manifest fields that drive the splash screen and task card

The splash screen is composed from three members and shown until first paint; `theme_color` colours the status bar and the recents card. Missing `background_color` yields a white splash, and an icon smaller than 512 px is scaled up.

```json
{
  "name": "Trail Notes",
  "short_name": "Trails",
  "id": "/",
  "start_url": "/?source=installed",
  "scope": "/",
  "display": "standalone",
  "background_color": "#101820",
  "theme_color": "#101820",
  "icons": [
    { "src": "/icons/maskable-512.png", "sizes": "512x512", "type": "image/png", "purpose": "maskable" },
    { "src": "/icons/any-512.png", "sizes": "512x512", "type": "image/png" }
  ]
}
```

The `source=installed` marker records the launch URL used by this example. Anyone can open that URL in a tab, and later navigation can remove the parameter, so it does not prove a WebAPK is installed. Keep a stable manifest `id` when adding launch tracking; for an existing app, preserve the identifier Chrome already computes instead of copying this example's `/` ([manifest ID guidance](https://developer.chrome.com/docs/capabilities/pwa-manifest-id)).

### Reading the display mode without guessing the package type

The [`display-mode` media feature](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/At-rules/@media/display-mode) reports how the page is displayed. It does not expose an Android package name. A page can also enter fullscreen through the Fullscreen API, so fullscreen alone is not an installation check.

```js
const modes = [
  'window-controls-overlay', 'standalone', 'minimal-ui',
  'fullscreen', 'picture-in-picture', 'browser',
];
const displayMode = modes.find(mode =>
  matchMedia(`(display-mode: ${mode})`).matches
) ?? 'unknown';
const hasLaunchMarker =
  new URL(location.href).searchParams.get('source') === 'installed';

console.log({ displayMode, hasLaunchMarker });
```

Use these values for presentation or launch analytics. A missing marker cannot distinguish a deep link from ordinary navigation, or a WebAPK from a shortcut. Test each web API before using it.

The [`appinstalled` event on Android](https://web.dev/learn/pwa/detection#app_installation) can fire before WebAPK minting and installation finish. Do not treat that event as confirmation that the Android package is ready.

:::note
Chromium defines the prefix for minted WebAPK package names as `WEBAPK_PACKAGE_PREFIX = "org.chromium.webapk"` in [`WebApkConstants.java`](https://github.com/chromium/chromium/blob/main/components/webapk/android/libs/common/src/org/chromium/components/webapk/lib/common/WebApkConstants.java). web.dev's [WebAPKs](https://web.dev/articles/webapks) article says installing through an APK lets the app show up in the app launcher and in Android's app settings, and that tapping a link inside the app's `scope` opens the app instead of a browser tab.
:::

## See also

- [WebAPKs on Android](https://web.dev/articles/webapks) (web.dev)
- [Installation](https://web.dev/learn/pwa/installation) (web.dev)
- [WebAPK browser support](/compatibility/webapk/)
- [Trusted Web Activity](/reference/installation/twa/)
- [beforeinstallprompt event](/reference/installation/install-prompt/)
- [The N+1 install problem](/reference/installation/n-plus-one/)
- [PWAs on Chrome for Android](/reference/platforms/chrome-android/)