views:

184

answers:

3

I have an iPhone Web App. I'm interested in detecting if the app was loaded either from: 1. iPhone Safari 2. iPhone installed web app (via the add to my homescreen) which loads without the safari bars.

Any ideas?

A: 

Check the HTTP-Headers when accessing the site from iPhone Safari and the WebApp to see if they are different.

I don't know if they are, but if they are, I'm sure you'll be able to implement that somewhere in your website.

http://php.net/manual/en/function.headers-list.php

Emil
+7  A: 

You can determine whether a webpage is displayed in full-screen mode using the window.navigator.standalone read-only Boolean JavaScript property. http://developer.apple.com/safari/library/documentation/AppleApplications/Reference/SafariHTMLRef/Articles/MetaTags.html

if (window.navigator.standalone) {
    // fullscreen mode

}
Shaji
Freakin' awesome! I had no idea I could do this.
kingjeffrey
A: 

Maybe you could use two different URIs ;-)

fravelgue