This script was rebuilt and moved into a proper Github repo: https://github.com/mckamey/doubleTap.js
See the old version for a more basic polyfill which only implements the dblclick event.
/* | |
* Copyright (C) 2008 Apple Inc. All Rights Reserved. | |
* | |
* Redistribution and use in source and binary forms, with or without | |
* modification, are permitted provided that the following conditions | |
* are met: | |
* 1. Redistributions of source code must retain the above copyright | |
* notice, this list of conditions and the following disclaimer. | |
* 2. Redistributions in binary form must reproduce the above copyright | |
* notice, this list of conditions and the following disclaimer in the |
This script was rebuilt and moved into a proper Github repo: https://github.com/mckamey/doubleTap.js
See the old version for a more basic polyfill which only implements the dblclick event.
package org.example.www.filters; | |
import java.io.IOException; | |
import java.util.*; | |
import javax.servlet.*; | |
import javax.servlet.http.*; | |
/** | |
* Modifies Accept headers and allows URL extensions to improve JAX-RS content negotiation | |
* Adds "Vary: accept" header to response |
Copyright (c) 2011 Stephen M. McKamey, http://mck.me | |
Permission is hereby granted, free of charge, to any person obtaining | |
a copy of this software and associated documentation files (the | |
"Software"), to deal in the Software without restriction, including | |
without limitation the rights to use, copy, modify, merge, publish, | |
distribute, sublicense, and/or sell copies of the Software, and to | |
permit persons to whom the Software is furnished to do so, subject to | |
the following conditions: | |
/** | |
* Creates a function which fires only once when called in quick succession | |
* @param {function...} action the function to fire | |
* @param {number} delay amount of time until considered done, default:100ms | |
* @param {boolean} asap if should execute at the start of the series (true) or the end (false), default:false | |
* return {function} debounced function | |
*/ | |
var debounce = function(action, delay, asap){ | |
if ('function' !== typeof action) { | |
return null; |
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/ | |
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating | |
// requestAnimationFrame polyfill by Erik Möller | |
// fixes from Paul Irish and Tino Zijdel | |
// perf improvements by Stephen McKamey | |
(function(window) { | |
'use strict'; |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Mobile Webkit reflow issue</title> | |
<meta name="viewport" id="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" /> | |
<meta name="apple-mobile-web-app-capable" content="yes" /> | |
<meta name="apple-mobile-web-app-status-bar-style" content="black" /> |
<!doctype html><link rel="stylesheet" href="http://codepen.io/stylesheets/css/normalize.css"><style> | |
html { | |
background-image: linear-gradient(#8b9da9, #fff6e4); | |
box-shadow: inset 0 0 100px hsla(0,0%,0%,.3); | |
min-height: 100%; | |
} | |
body { | |
background-color: #082746; | |
background-image: linear-gradient(20deg, transparent 67%, hsla(0,0%,100%,.05) 67%, hsla(0,0%,100%,.025)), |
The way you can do this for "http://" URLs (and what I think Apple and Spotify do) this is to:
Register a custom URL scheme [like the other answers have shown][1].
Set up your HTTP URL to point to a real webpage.
Put a script on that page to redirect to your custom URL if is on iOS.
For example, here is a sample page which will take you to the Twitter app for a particular user or the Twitter website depending upon if you are on the web or on your iOS device.
(function (window) { | |
'use strict'; | |
if (window.localStorage && window.sessionStorage) { | |
return; | |
} | |
// initialize if data already stored | |
var data = JSON.parse(window.name || '{}'); |