-
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
Way to detect if a web app is installed #1092
Comments
Previously #273 |
This is the first I'm hearing of Q: Is there a difference between I would prefer to have some way to express that as a CSS MQ. I seem to be able to express it using
I don't follow this (also, which spec?). If you use |
Note from chatting with Marcos: Yes it basically is dm: fullscreen is true when you're in the browser but fullscreen mode. But Further discussion: Ideally such a thing would be itself a new MQ, not a JavaScript Boolean with somewhat the wrong name. So we can design a new MQ for it. But that aside, should we just standardize Matt will ask around internally to see if we have seen compat issues due to a lack of |
Having a corresponding media feature/query would be great, particularly given the use case is generally to control the web page's UI (generally to take away install buttons and instructions). It could be as simple as ( |
FWIW, it's been something iOS-focused web developers have depended upon and expected to be in Chrome DevTools' iOS device simulation mode, so I filed crbug/1197498 some time ago. I'm not opposed to standardizing it as a legacy feature. The future is definitely non-ambiguous media queries where you can exactly express what you want to test for, which is why I created the WebKit bug. If WebKit decides to report it, there should probably a differentiation between navigation controls on (corresponds to |
Update here. Standardizing What happened?Mozilla to detect the iPad Pro was using So Safari 17 Desktop with Mozilla fixed it. So this is to keep in mind in the solutions that needs to be evaluated. |
One potential difference here, if you want an "is this installed" bit, is that display mode css media query is spec'd to be the current display mode, which includes 'fullscreen'. So if you have an installed app that you go fullscreen, then it'll be "standalone" -> "fullscreen" -> "standalone" (when you exit fullscreen). This seems to really confuse developers, so I propose we have a signal that is something like "is this URL within scope of an installed app" signal (this allows it to work with Safari & Chrome's different implementations of isolation). |
@dmurph, that's an interesting re-interpretation and might work. However, when you say "This seems to really confuse developers", what is "this" exactly? Can you clarify a bit? |
Reminder: there's a lengthy discussion of an “installed” signal on the App Info spec: w3c/manifest-app-info#42 There is also the Client Hint for display modes proposal too (though that's more server side). Of course I'm also still super skeptical about the wisdom in relying on display modes as an indication of installation. I'd much prefer an explicit signal that you are, in fact, viewing the site in it's installed state (hence the discussion above). I'm not entirely sure what's to be gained from having this. I'm not deadset against it, I guess I'm just not convinced of the value yet. |
Discussing with @dmurph, as an alternative:
And we keep the legacy:
As WebKit/Safari Web Apps are fully isolated (they are an entirely different user agent), there is no way of sharing "is this web app installed". For a site in a browser to know if a web app is (or was) installed would break the privacy model of Safari. |
I can understand how, when compared to the web overall, this would be an issue, but this is not something shared by apps developed in Swift, even those that make use of the web view, right? I'm also curious to know what Apple's specific privacy concerns are, especially if the check only applied specifically within the context of the installed app and not in a casual browsing (e.g., browser tab) scenario. |
Action here is to float this with the CSS Working Group. You say "installed" in cases where you wouldn't want to show an install button... has the user "installed" this web application. Only applies to top-level navigable. This can't apply cross origin. Cross-origin must return false (or "no"). |
Feedback here: https://issues.chromium.org/issues/331692948#comment15
This is supportive evidence for an 'installed' attribute that can be media-queried. |
Also interested in thoughts from folks on this doc: https://bit.ly/pwa-detecting-install |
It's impossible to know if our app is running as a PWA when using Chrome Enterprise Kiosk & Signage, which is really impactful because Chrome Enterprise Kiosk doesn't allow users to open external links at all. We need to handle this, but there's no way to detect if our app is running as a PWA in Chrome Enterprise Kiosk. |
Hey @tomayac or @reillyeon, can you please see #1092 (comment) ... it's a bit out of scope for this repo, but maybe a quick response to the above? |
This looks more like a Chrome feature request than something we'd want to discuss in the manifest spec repository. Could you open a new Chrome bug for this, please? |
@tomayac Chrome team sent us here |
I'm not sure what Chrome Enterprise does exactly in kiosk mode. The usual flow would be to chck |
@tomayac Chrome Enterprise behaves exactly like regular Chrome, except Chrome Enterprise cannot open external links in kiosk mode. In both cases, it is impossible to determine if an app is running as a PWA when fullscreen is enabled (which is always the case "fullscreen" in Chrome Enterprise Kiosk). When Chrome Enterprise Kiosk runs a PWA, a regular browser page in fullscreen mode, or a PWA on Chrome, all return check this comment: https://issues.chromium.org/issues/331692948#comment4 |
The
navigator.standalone
attribute has been in iOS since forever and has the nice semantics in that, as a boolean value, it distinguishes between installed web applications and those running in the regular browser tab.It's slightly unfortunate that "standalone" will mean "installed" (as per the spec's definition), and there is also "display-mode: standalone", but I think that's ok.
What do folks here think? @dmurph, @aarongustafson, would love to hear your thoughts!
See also this webkit bug.
The text was updated successfully, but these errors were encountered: