Web app ACT "Open in browser" crashes the web app

#41495930 + #510460240 (non-WebAPK) Filed 2024-01-29 Android / PWA / Custom Tabs

Symptom

An installed PWA (standalone) opens a target="_blank" link in the in-app browser (Android Custom Tab). Choosing Open in Chrome from that in-app browser's overflow menu opens the URL in Chrome but also tears down the originating PWA:

WebAPK

PWA cold-reloads

The web app is killed and reloads its start_url, losing all in-page state (issue 41495930). With a 3rd-party launcher it drops to home.

Non-WebAPK (shortcut)

PWA window closes

The web app window is finished and removed from the app overview entirely (issue 510460240).

Firefox keeps the installed web app alive in the same situation.

Live reproducer (installable PWA)

How to run

  1. Open this page on Android in Chrome and launch the PWA sampler below.
  2. In Chrome's menu choose Add to Home screen / Install app.
  3. Launch the installed ACTRepro app (opens standalone).
  4. Tap the target="_blank" button → in-app browser opens.
  5. In-app browser menu → Open in Chrome.
  6. Return to the PWA. It should keep the same session id.
▶ Launch PWA sampler ⬇ arm64 APK (fixed build)

The APK is a local org.chromium.chrome build with the fix. Verified on a Pixel 6a (Android 16): with unfixed stable Chrome "Open in Chrome" removes the PWA from recents; with this build the PWA task stays alive.

Expected vs actual

Expected

PWA kept alive

"Open in Chrome" opens the URL in the main browser; the installed web app stays alive in the background with its state and session id intact (Firefox behaviour).

Actual

PWA torn down

The web app is finished: a WebAPK cold-reloads its start_url (new session id), a shortcut PWA is removed from the app overview entirely.

Links