-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbrowsertest.html
More file actions
95 lines (68 loc) · 2.74 KB
/
browsertest.html
File metadata and controls
95 lines (68 loc) · 2.74 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<!DOCTYPE html>
<html lang="de">
<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>SlamScoreBoard</title>
<!-- Bootstrap -->
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css" rel="stylesheet">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<style>
.ok { color: green; }
.nok { color: red; }
</style>
</head>
<body>
<div class="container">
<h1>Is my browser fit for SlamScoreBoard?</h1>
<div id="place">
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>
<script>
var t = ['localStorage', 'File', 'FileReader', 'FileList', 'Blob', 'JSON'];
$('#place').html('<ul id="testList"></ul>');
var jEl = $('#testList');
for (var i = 0, len = t.length; i < len; i++) {
var isOk = window['supports_' + t[i]]();
console.log(jEl);
jEl.append('<li><b>' + t[i] + '</b> ' + (isOk ? '<span class="ok">OK</span>' : '<span class="nok">Fail</span>'));
}
function supports_localStorage() {
return inWindow('localStorage');
}
function supports_File() {
return inWindow('File');
}
function supports_FileReader() {
return inWindow('FileReader');
}
function supports_FileList() {
return inWindow('FileList');
}
function supports_Blob() {
return inWindow('Blob');
}
function supports_JSON() {
if (typeof JSON !== 'undefined' && typeof JSON.parse === 'function' && typeof JSON.stringify === 'function') {
return true;
}
return false;
}
function inWindow(str) {
try {
return str in window && window[str] !== null;
} catch (e) {
return false;
}
}
</script>
</body>
</html>