manifest: launch_handler support
Published Updated
manifest: launch_handler — The launch_handler member’s client_mode sub-field
controls how an installed PWA is launched: whether it reuses an existing app window or
opens a new one, and whether that window is navigated to the launch’s target URL.
Browser & ecosystem support
Section titled “Browser & ecosystem support”- Legend
- Yes
- Partial
- Flag
- No
- Unknown
| Browser / Platform | Support | Versions | Confidence | Source | Notes |
|---|---|---|---|---|---|
| Chrome (Desktop) | Yes | 110 | high | source | — |
| Chrome (Android) | Yes | 110 | high | source | 1 |
| Edge (Desktop) | Yes | 110 | high | source | 2 |
| Firefox (Desktop) | No | — | high | source | 3 |
| Firefox (Android) | No | — | high | source | 45 |
| Safari (macOS) | No | — | high | source | 6 |
| Safari (iOS) | No | — | high | source | 78 |
| Samsung Internet | Yes | 21.0 | high | source | 9 |
| WebView (Android) | Yes | 110 | high | source | 10 |
- Derived by browser-compat-data mirroring from Chrome.
- Derived by browser-compat-data mirroring from Chrome.
- No Firefox support is recorded in browser-compat-data.
- No Firefox for Android support is recorded in browser-compat-data.
- Derived by browser-compat-data mirroring from Firefox.
- No Safari support is recorded in browser-compat-data.
- No Safari on iOS support is recorded in browser-compat-data.
- Derived by browser-compat-data mirroring from Safari.
- Derived by browser-compat-data mirroring from Chrome Android.
- Derived by browser-compat-data mirroring from Chrome Android.
Setting client_mode
Section titled “Setting client_mode”Per Chrome for Developers, launch_handler has one sub-field, client_mode, and defaults
to {"client_mode": "auto"} when unspecified:
{ "launch_handler": { "client_mode": "navigate-new" }}Per MDN, the allowed client_mode values are navigate-new (always open a new client),
navigate-existing (focus and navigate an existing client, falling back to
navigate-new if none is open), focus-existing (focus an existing client without
navigating it, again falling back to navigate-new if none is open), and auto (the
user agent picks whichever behavior fits the platform).
Reading the launch target with LaunchQueue
Section titled “Reading the launch target with LaunchQueue”Per MDN, whichever client_mode is used, the launch’s target URL is made available
through window.launchQueue for custom navigation handling:
if ("launchQueue" in window) { window.launchQueue.setConsumer((launchParams) => { if (launchParams.targetURL) { const url = new URL(launchParams.targetURL); // Route the already-open app window to the launched URL yourself. history.pushState(null, "", url.pathname + url.search); } });}Detecting support and falling back
Section titled “Detecting support and falling back”Feature-detect "launchQueue" in window before registering a consumer. When
launchQueue is unavailable, the fallback below routes from the page’s current
location:
if ("launchQueue" in window) { window.launchQueue.setConsumer((launchParams) => { if (launchParams.targetURL) { route(new URL(launchParams.targetURL)); } });} else { // LaunchQueue is unavailable — fall back to the current page URL. route(new URL(location.href));}What goes wrong
Section titled “What goes wrong”- Firefox and Safari do not implement
launch_handler, per the compatibility data above — always provide a fallback that works fromlocationalone. -
navigate-existingandfocus-existingboth fall back tonavigate-newbehavior when no client is already open, per MDN — do not assume an existing window exists. - Feature-detect
"launchQueue" in windowbefore callingsetConsumer(). -
navigate-newandnavigate-existingnavigate a client to the target URL;focus-existingdoes not, so handlelaunchParams.targetURLwhen that mode should route the focused client to the target.
Where to go next
Section titled “Where to go next”- manifest: file_handlers support — another
manifest member that delivers launch data through
window.launchQueue. - manifest: share_target support — a related manifest member for handling incoming data on launch.
← Back to the Compatibility explorer.