Skip to content
AnswerWell geo Documentation

Research · 7 min read · Answerwell

PWA Link Capturing, Launch Handler, and Navigation Management

How installed PWAs capture links, route launches via launch_handler and launchQueue, and how browser defaults interact with manifest settings.

This page summarises Google Chrome documentation on navigation management for installed Progressive Web Apps (PWAs): when a link opens the installed app versus a browser tab, how developers control window focus and navigation through the Launch Handler API, and how older APIs such as Declarative Link Capturing fit in. The underlying web platform also defines imperative protocol registration in the HTML registerProtocolHandler() method and security guidance in the WHATWG HTML specification.

Section titled “navigation capturing: when links open an installed PWA”

Navigation capturing is the browser process that decides whether clicking or tapping a link should launch an installed PWA or open a new browser tab. Navigation management into installed PWAs describes it as a critical part of navigation management, alongside user actions and developer controls.

From Chrome 139 on Windows, macOS, and Linux, the default changed so that capturable links to an installed, in-scope PWA tend to open in that PWA automatically. The tab is used only when the PWA is not installed or the user has opted out:

The new, unified approach for navigation capturing, automatically opens links in their corresponding installed PWA. Links will only fall back to a browser tab if the PWA isn’t installed or if the user has opted out.

— Google Chrome, Navigation management into installed PWAs

That behavior matters when users follow HTTPS links from another site, a chat app, or a calendar invite into an app they already installed—as in the Google Chat PWA example in the same guide.

When the user activates a link, the browser runs a short decision chain. Navigation management into installed PWAs lists these steps:

  1. Determine if the navigation is capturable — generally when it creates a new frame and does not open in an auxiliary browsing context.
  2. Identify a controlling PWA — find an installed PWA whose manifest scope includes the target URL (the processed manifest’s scope; if scope is absent, it defaults to the parent path of start_url, as described in Declarative Link Capturing).
  3. Verify user preference — respect opt-out in app settings.
  4. Launch the PWA — use the launch handling algorithm; developers influence this with the Launch Handler API.

Capturing applies to navigations from outside the PWA’s navigation scope—for example a link on calendar.example.com to a URL inside the chat app’s scope—not to ordinary in-tab browsing inside scope.

Launch Handler API: launch_handler, client_mode, and launchQueue

Section titled “Launch Handler API: launch_handler, client_mode, and launchQueue”

The Launch Handler API runs after the browser chooses to launch the PWA. It controls whether the launch uses a new window, navigates an existing window, or delivers the URL to JavaScript without automatic navigation.

The Launch Handler API lets you control how your app is launched, for example, whether it uses an existing or a new window and whether the chosen window is navigated to the launch URL. As with the File Handling API, this also enqueues a LaunchParams object in the launched page’s window.launchQueue.

— Google Chrome, Launch Handler API

Add a launch_handler member with client_mode (the navigation guide also refers to this field; the dedicated Launch Handler doc uses client_mode consistently):

{
"launch_handler": {
"client_mode": "navigate-new"
}
}

If omitted, the default is {"client_mode": "auto"} per Launch Handler API. Allowed values:

client_mode Behavior
navigate-new Create a new browsing context in a PWA window for the launch URL.
navigate-existing Navigate the most recently used PWA browsing context to the launch URL.
focus-existing Focus an existing context; enqueue LaunchParams with targetURL on window.launchQueue (no automatic navigation).
auto User agent chooses (e.g. single-window mobile vs multi-window desktop).

client_mode may be an array; the first supported value wins, so sites can list newer modes ahead of fallbacks.

Navigation management into installed PWAs notes the API is available from Chrome 110 and becomes more useful with navigation capturing updates; configure launches when external links should reuse one Chat-style instance (focus-existing) instead of spawning windows.

For focus-existing (and file launches), register a consumer once per launch:

if ('launchQueue' in window) {
launchQueue.setConsumer((launchParams) => {
if (launchParams.targetURL) {
const songID = extractSongId(launchParams.targetURL);
if (songID) {
playSong(songID);
}
}
});
}

The File Handling API uses the same queue for launchParams.files. Launches are queued until a consumer is set, and each launch invokes the consumer once.

Section titled “Map from deprecated capture_links to launch_handler”

Declarative Link Capturing migration table:

Old capture_links New launch_handler.client_mode
new-client navigate-new (doc also showed route_to: "new-client" during transition)
existing-client-navigate navigate-existing
existing-client-event (not in old origin trial) focus-existing — handle LaunchParams in JS via launchQueue.setConsumer()

From Chromium 98 onward, automatic link capturing is a user opt-in (for example Open with → Remember my choice, or per-app settings), not granted silently at install. Link capturing was ChromeOS-only for a time with desktop support in progress, as noted in the same Declarative Link Capturing article.

Related entry points: protocols, URLs, files, and share

Section titled “Related entry points: protocols, URLs, files, and share”

Navigation capturing focuses on HTTPS links in scope. Other launch paths often still end at launchQueue:

URL protocol handlers (protocol_handlers and registerProtocolHandler)

Section titled “URL protocol handlers (protocol_handlers and registerProtocolHandler)”

Sites can register custom schemes with navigator.registerProtocolHandler(scheme, url) where url must contain %s as the placeholder for the handled URL (HTML for Web Developers). PWAs can declare handlers in the manifest via protocol_handlers (URL protocol handler registration for PWAs). Test installed handlers under Application → Manifest → Protocol Handler in DevTools (Debug Progressive Web Apps).

The WHATWG specification warns that custom scheme handlers can enable tracking, default hijacking, registration spam, metadata injection, and leaks of private data when a page assumes an in-org handler but the user registered an external one (8.10.1.4.1 Security and privacy).

Section titled “PWAs as URL handlers (url_handlers → handle_links)”

PWAs as URL Handlers let an installed PWA claim HTTPS origin patterns via url_handlers, validated with /.well-known/web-app-origin-association on each origin. Support for experimental url_handlers is being replaced by the standardized handle_links member; see the warning on that page.

Web Share Target registers a share_target in the manifest so the OS can share into an installed app. Web App Scope Extensions extends in-scope treatment to associated origins via scope_extensions plus reciprocal web-app-origin-association files—relevant when marketing and app live on different origins; cross-origin link capturing integration varies by platform.

  • Using navigate-existing on stateful apps — Declarative Link Capturing warned that existing-client-navigate can navigate away from pages with beforeunload and risk data loss; the same caution applies to navigate-existing launch modes.
  • Expecting capture inside the browser tab — URL handler proposals target navigations outside the browser; in-tab links follow normal navigation rules (PWAs as URL Handlers).
  • Ignoring user opt-out — even with a controlling PWA, preference settings can force a tab (Navigation management into installed PWAs).
  • Missing id when migrating origins — Web App Origin Migration moves installation only on same-site origins; it does not move storage, cookies, or permission grants—plan data migration separately.
  • Tabbed PWAs — with display_override: ["tabbed"], client_mode: navigate-new opens a new tab in the existing window (Tabbed application mode for PWAs).
  1. Open your PWA landing page in Chrome, install it from the address bar, and watch the Console for manifest issues as described in Debug Progressive Web Apps.

  2. From a page outside your manifest scope, click a deep link into the app and confirm whether the standalone window opens (Chrome 139+ default) or a tab appears when the app is missing or opted out—per Navigation management into installed PWAs.

  3. In Application → Manifest, verify launch_handler.client_mode and test launch behavior; for protocol handlers use Protocol Handler → Test protocol (URL protocol handler registration for PWAs).

  4. If you declare scope_extensions or url_handlers, confirm each origin serves /.well-known/web-app-origin-association exactly as named in Web App Scope Extensions or PWAs as URL Handlers.

  5. You can check automatically in Answerwell (our tool): https://answerwell.org/workspace

If something on this page is wrong or unclear, email yimasynthetic@gmail.com with the page URL and the exact statement you are asking about, and we will correct or clarify it.