-
Notifications
You must be signed in to change notification settings - Fork 162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Additional property to define a webapp to be single instance (single-tab) #479
Comments
I think that is covered by the "scope" member to a degree: a user launching an app would open at the start URL, but subsequent (re)launches of the app, if the app is already open, could simply refocus the tab and not navigate. We should probably clarify that in the spec. |
That would be great! Thanks! |
I don't think this behaviour should necessarily be part of the spec. While one window per app is common on mobile, that's not so much the case on desktop. Also, being able to have the same website/app open in multiple tabs is arguably a feature the web has which many native app platforms do not. Perhaps the user wants two instances of the app open to do a side-by-side comparison. I'm curious about the underlying motivations for this - really web pages should be designed with the assumption that they can be opened in multiple tabs at the same time as this is usually the case in the browser. |
I disagree with your conclusion that there is no need for a signle tab feature. As you say there is no need to specify a multiple tabs feature for web apps because this behaviour is the only one which exists today. For the most apps this is just fine because they just don't care about how many tabs the user has opened. Some apps even make use of multiple tabs. But there is really no argument to say that all web apps of the future should be designed this way. Instead I would like to argue why a single tab feature is needed and required to be supported by the spec from my perspective:
|
How will you make your web app backwards-compatible with web browsers which do allow users to open it in multiple tabs simultaneously? I'd suggest you might want to reconsider the design of your app rather than the design of browsers. |
Yes, that's a fact. My web app supports multiple tabs because the design of browsers forces me to. The argument of backwards-compatibility is only a matter of time. Many APIs are adopted by major browsers in a short period of time. Compatibilty is the worst argument against the single tab feature because existing features are not touched. Instead the new feature is only an additional feature. |
Can you solve this issue already with service workers? That is, keep track of open windows in your service worker, and send new navigations into open windows, if any exist? |
Maybe, I don't know how to intervene in a navigation with SW.
I get how one could check the focused clients through the SW, but never seen intervention of navigation. Would love to see some code, even if a rough sketch. |
As an aside, I tend to agree with @benfrancis that this is complicated given browser behavior (I don't see that changing - though behavior that matches launching native apps from the home screen is obviously something we want too). So if we can solve it with SWs, then that would great. |
After doing some reading I think this isn't possible currently with SWs, but the pieces are almost there:
|
I think service workers are more suitable to do this. Perhaps not with the |
Native applications usually use file lock or named pipe to achieve this purpuse, so I think the web need similar mechanism. In one of my project, we use Some previous discussion: https://lists.w3.org/Archives/Public/public-webapps/2015JulSep/0151.html |
@delapuente, can you check the link to the SW issue? It seems to point back here. |
Github automatically generated a link to the issue "Consider providing |
Duplicates #597 (and discussion has moved there). |
Might the manifest be a possible solution for the following issue?
http://stackoverflow.com/questions/38274915/how-to-launch-webapps-as-a-single-tab-single-instance-app
The text was updated successfully, but these errors were encountered: