大网数据广告活动
Web 标准与前端开发

launch_handler

· 52CE 我爱测

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

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:</p>
      • 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.
      • navigate-existing
        • : 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.
      • navigate-new
        • : 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

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

Specifications

Browser compatibility

See also

来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。

资料来源与适用范围

资料来源
MDN Web Docs / Mozilla 贡献者
适用范围
请按文中版本与环境说明核对
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 2.5

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。