-
Notifications
You must be signed in to change notification settings - Fork 16
/
index-fixed.html
25 lines (23 loc) · 976 Bytes
/
index-fixed.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
<!DOCTYPE html>
<html>
<head>
<title>Primary Site Fixed</title>
</head>
<body>
<script>
var is_safari = navigator.userAgent.indexOf("Safari") > -1;
// Chrome has Safari in the user agent so we need to filter (https://stackoverflow.com/a/7768006/1502448)
var is_chrome = navigator.userAgent.indexOf('Chrome') > -1;
if ((is_chrome) && (is_safari)) {is_safari = false;}
if (is_safari) {
// See if cookie exists (https://stackoverflow.com/a/25617724/1502448)
if (!document.cookie.match(/^(.*;)?\s*fixed\s*=\s*[^;]+(.*)?$/)) {
// Set cookie to maximum (https://stackoverflow.com/a/33106316/1502448)
document.cookie = 'fixed=fixed; expires=Tue, 19 Jan 2038 03:14:07 UTC; path=/';
window.location.replace("http://vit-demos.appspot.com/_safari_fix.html");
}
}
</script>
<iframe src="http://vit-demos.appspot.com/framed.html" width="50%" height="400" frameborder="2"></iframe>
</body>
</html>