Once installed on Windows, macOS, ChromeOS or Linux, Chromium-based browsers give PWAs several hooks into the desktop.
Handle custom links: protocol_handlers
"protocol_handlers": [
{ "protocol": "web+jam", "url": "/open?link=%s" },
{ "protocol": "mailto", "url": "/compose?to=%s" }
]
Custom schemes must start with web+. A few safe-listed schemes such as mailto, magnet and irc are allowed too. Users approve the first launch.
Control how launches open: launch_handler
"launch_handler": { "client_mode": ["navigate-existing", "auto"] }
navigate-new: always a new window.navigate-existing: reuse the most recent window and navigate it.focus-existing: focus the existing window and pass the URL tolaunchQueuewithout navigating.
focus-existing is ideal for single-window apps like music players and editors.
Draw your own title bar: window controls overlay
Opt in with "display_override": ["window-controls-overlay"], then lay out your title bar using the titlebar-area-* environment variables. Code in display modes.
Other desktop touches
- Shortcuts in the taskbar or Dock menu: richer install UI.
- Badges on the icon: Badging API.
- File handlers: files.
- Run on OS login: users can turn this on from the app's settings in Chrome and Edge.
- Edge side panel:
"edge_side_panel": { "preferred_width": 480 }lets users pin your app in Edge's sidebar. - Tabbed mode:
"display_override": ["tabbed"](experimental) gives the app window its own tabs.
All of these are progressive: browsers that do not support them simply ignore the fields.
Compatibilidade de navegadores
| Recurso | Chrome / Edge desktop | Chrome Android | Safari iOS / iPadOS | Safari macOS | Firefox desktop | Firefox Android | Samsung Internet |
|---|---|---|---|---|---|---|---|
| Protocol handlers | Chrome / Edge desktop: Sim | Chrome Android: Não | Safari iOS / iPadOS: Não | Safari macOS: Não | Firefox desktop: Não | Firefox Android: Não | Samsung Internet: Não |
| Launch handler | Chrome / Edge desktop: Sim | Chrome Android: Varia | Safari iOS / iPadOS: Não | Safari macOS: Não | Firefox desktop: Não | Firefox Android: Não | Samsung Internet: Não |
| Window controls overlay | Chrome / Edge desktop: Sim | Chrome Android: Não | Safari iOS / iPadOS: Não | Safari macOS: Não | Firefox desktop: Não | Firefox Android: Não | Samsung Internet: Não |