Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View cjanis's full-sized avatar

Craig Janis cjanis

View GitHub Profile
@cjanis
cjanis / gist:3910234
Created October 18, 2012 07:01
Resume iOS Web App on last open web page
if (window.navigator.standalone) {
var setLastUrl = function() {
localStorage['lastUrl'] = window.location;
}
if (sessionStorage['init']) {
setLastUrl();
} else {
sessionStorage['init'] = true;
if (localStorage['lastUrl']) {
if (localStorage['lastUrl'] != window.location) {
@cjanis
cjanis / gist:3908053
Created October 17, 2012 20:44 — forked from kylebarrow/example.html
Prevent internal links in iOS standalone web apps from opening in Mobile Safari
if (window.navigator.standalone) {
var local = document.domain;
$('a').click(function() {
var a = $(this).attr('href');
if ( a.match('http://' + local) || a.match('http://www.' + local) ){
event.preventDefault();
document.location.href = a;
}
});
}
@cjanis
cjanis / gist:3907067
Created October 17, 2012 18:01 — forked from tfausak/ios-8-web-app.html
iOS Standalone Web App Settings, Icons, and Startup Images
<!-- ios standalone web app -->
<meta name="apple-mobile-web-app-capable" content="yes">
<!-- ios status bar appearance, options: black, black-translucent -->
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<!-- ios icon, just one size because ios will scale it, remove "-precomposed" if you want ios to add effects -->
<link href="icon@144x144.png" sizes="144x144" rel="apple-touch-icon-precomposed">
<!-- ios startup images -->