Is there a way of telling whether my Web Application has been launched from a button on the user's iPhone home screen? I want to display a "add this WebApp to your home screen" prompt if the user has accessed the WebApp via safari by typing in a URL.
+1
A:
In Safari, the scrollY
will start at a negative value if inside Safari, and at 0 if running as an application.
Likely the viewport will change as well (if it does, this is a more reliable method)
rpetrich
2009-09-26 15:51:52
I think the OP is talking about the user opening Safari from a bookmark saved to the user's home screen, not Webkit instances in non-Safari applications
Gareth
2009-09-26 15:58:35
Yes, this is what I'm talking about too.
rpetrich
2009-09-26 16:43:45
A:
If I remember correctly there's a thing in the server log that shows what the user's previous page was. So the only way I can think of is if the user was on a previous page display the "add" thing, and if they didn't don't
Matt S.
2009-09-26 16:07:56
+7
A:
window.navigator.standalone
True if you have launched from the Home Screen. False if in the Safari browser.
Documented here:
It works with OS 2.1 and up.
Peter
GeoNomad
2009-10-07 23:34:49