-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlp.html
43 lines (38 loc) · 1.12 KB
/
lp.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Redirecting ...</title>
<script>
var appstoreFail = "http://www.claravista.fr";
//Check is device is iOS
var iOS = (navigator.userAgent.match(/(iPad|iPhone|iPod)/g) ? true : false );
var appUrlScheme = "twitter://post?message=COOKIE_IS_GOOD_FOR_YOUR_HEALTH";
if (iOS)
{
//If the app is not installed the script will wait for 2sec and redirect to web.
var loadedAt = +new Date;
setTimeout(function() {
if (+new Date - loadedAt < 1000){
window.location = appstoreFail;
}
}
, 25);
//Try launching the app using URL schemes
try {
window.location = appUrlScheme;
} catch(e) {}
} else {
//Launch the website
window.location = "http://www.google.fr";
}
</script>
</head>
<body>
<div class="container">
<h1>Redirecting ...</h1>
</div>
</body>
</html>