WICG / manifest-incubations

Before install prompt API for installing web applications
https://wicg.github.io/manifest-incubations/
Other
99 stars 29 forks source link

Add manifest field for single window applications #91

Open alancutter opened 11 months ago

alancutter commented 11 months ago

"launch_handler": { "client_mode": "navigate-existing" } effectively makes a web app single window though it explicitly does not prevent multiple windows or clients from being instantiated.

launch_handler is intended to be a declarative version of something the app can do itself programmatically in some future service worker launch event. Currently Chrome is considering removing menu options like "new window" when navigate-existing is set. This would violate the theoretical programmatic equivalence.

We should add a new manifest field e.g. "window_mode": "singular" that explicitly states the app wishes to be a single windowed app and gives the user agent permission to alter its UI around that as well as enforce it.

alancutter commented 11 months ago

If a web app is tabbed display mode navigate-existing isn't a good option for it to try to be single windowed as it operates on clients (tabs) rather than windows.

mgiuca commented 11 months ago

Thanks Alan. I agree, it may be desirable for a web app to ask the user agent to not allow multiple instances of itself (or in tabbed mode, this would mean "allow multiple tabs but only a single window").

We would never prevent the user from opening multiple browser tabs of a website, but if we move into an isolated model for installed apps (which has been discussed recently and implemented by Safari), then we can explicitly prevent multiple instances in the installed app state.

Either way, this would just be a hint, but I think it's important that we don't overload client_mode: navigate-existing to be that hint, for the reasons given above.