Tag Archive: html5

Jan 08 2013

iOS Homescreen App Links Open in Safari

On iOS, you can configure web-sites that have been added to the user’s home screen to open without the chrome around Safari by setting the meta tag:

<meta name="apple-mobile-web-app-capable" content="yes">

However, you’ll soon notice that when a user clicks on any links within the page, they’ll open up in a new Safari window (certainly not what you’d expect). The solution comes from Stack Overflow. If you’re using jQuery or Zepto:

$("body").on("click", "a", function(event) {
   event.target.target != "_blank" && (window.location = event.target.href);
});

Otherwise, you can use the following:

document.body.addEventListener(function(event) {
    if (event.target.href && event.target.target != "_blank") {
        event.preventDefault();
        window.location = this.href;                
    }
});

Permanent link to this article: http://negativefoo.org/2013/01/ios-homescreen-app-links-open-in-safari/

Jan 15 2012

HTML 5 Multimedia: Browser-Native Video, Audio, and Canvas



Permanent link to this article: http://negativefoo.org/2012/01/html-5-multimedia-browser-native-video-audio-and-canvas/