launch_handler

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The launch_handler member defines values that control the launch of a web application. Currently it can only contain a single value, client_mode, which specifies the context in which the app should be loaded when launched. For example, in an existing web app client containing an instance of the app, or in a new web app client. This leaves scope for more launch_handler values to be defined in the future.

Values

launch_handler objects may contain the following values:

client_mode

A string, or comma-separated array of strings, which specifies the context in which the app should be loaded when launched. If an array of strings is provided, the first valid value is used. Possible values are:

auto

The user agent decides what context makes sense for the platform to load the app in. For example, navigate-existing might make more sense on mobile, where single app instances are commonplace, whereas navigate-new might make more sense in a desktop context. This is the default value used if all the provided values are invalid.

focus-existing

If the app is already loaded in a web app client, it is brought into focus but not navigated to the launch target URL. The target URL is made available via Window.launchQueue to allow custom launch navigation handling to be implemented. If the app is not already loaded in a web app client, navigate-new behavior is used instead.

If the app is already loaded in a web app client, it is brought into focus and navigated to the specified launch target URL. The target URL is made available via Window.launchQueue to allow additional custom launch navigation handling to be implemented. If the app is not already loaded in a web app client, navigate-new behavior is used instead.

The app is loaded inside a new web app client. The target URL is made available via Window.launchQueue to allow additional custom launch navigation handling to be implemented.

Examples

json
{
  "launch_handler": {
    "client_mode": "focus-existing"
  }
}
json
{
  "launch_handler": {
    "client_mode": ["focus-existing", "auto"]
  }
}

Specifications

Specification
Web App Launch Handler API
# launch_handler-member

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
launch_handler
Experimental
Chrome – Full support
Chrome 110 (Release date: 2023-02-07)
footnote Full support
Edge – Full support
Edge 110 (Release date: 2023-02-09)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 96 (Release date: 2023-02-22)
footnote Full support
Safari – No support
Safari
footnote No support
Chrome Android – Full support
Chrome Android 110 (Release date: 2023-02-07)
footnote Full support
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – Full support
Opera Android 74 (Release date: 2023-03-13)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – Full support
Samsung Internet 21 (Release date: 2023-05-19)
footnote Full support
WebView Android – Full support
WebView Android 110 (Release date: 2023-02-07)
footnote Full support
WebView on iOS – No support
WebView on iOS
footnote No support
client_mode
Experimental
Chrome – Full support
Chrome 110 (Release date: 2023-02-07)
footnote Full support
Edge – Full support
Edge 110 (Release date: 2023-02-09)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 96 (Release date: 2023-02-22)
footnote Full support
Safari – No support
Safari
footnote No support
Chrome Android – Full support
Chrome Android 110 (Release date: 2023-02-07)
footnote Full support
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – Full support
Opera Android 74 (Release date: 2023-03-13)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – Full support
Samsung Internet 21 (Release date: 2023-05-19)
footnote Full support
WebView Android – Full support
WebView Android 110 (Release date: 2023-02-07)
footnote Full support
WebView on iOS – No support
WebView on iOS
footnote No support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
Experimental. Expect behavior to change in the future.

See also