iPhone WebApps, is there a way to detect how it was loaded? Home Screen vs Safari?

You can determine whether a webpage is displayed in full-screen mode using the window.navigator.standalone read-only Boolean JavaScript property. https://developer.apple.com/library/content/documentation/AppleApplications/Reference/SafariHTMLRef/Articles/MetaTags.html if (window.navigator.standalone) { // fullscreen mode }

iPhone “Bookmark to Homescreen” removes cookies and session?

A really simple approach could be to use a unique token in your Bookmark-URL which can serve you as a unique device identifier. Example: http://myWebApp.com/?token=randomId29238/1 The token can be generated at the server side at opening time of the application in Mobile Safari and before the user is prompted with the “Add to Home Screen” … Read more

Force link to open in mobile safari from a web app with javascript

This is possible. Tested with iOS5 stand-alone web app: HTML: <div id=”foz” data-href=”http://www.google.fi”>Google</div> JavaScript: document.getElementById(“foz”).addEventListener(“click”, function(evt) { var a = document.createElement(‘a’); a.setAttribute(“href”, this.getAttribute(“data-href”)); a.setAttribute(“target”, “_blank”); var dispatch = document.createEvent(“HTMLEvents”); dispatch.initEvent(“click”, true, true); a.dispatchEvent(dispatch); }, false); Can be tested here: http://www.hakoniemi.net/labs/linkkitesti.html