forked from WebPlatformTest/HTML5test
-
Notifications
You must be signed in to change notification settings - Fork 0
/
qr.html
151 lines (123 loc) · 5.61 KB
/
qr.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
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
<!DOCTYPE html>
<html>
<head>
<title data-i18n>HTML5test - How well does your browser support HTML5?</title>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=EDGE">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style type="text/css">
html {
font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", "Helvetica", "Arial", "Lucida Grande", sans-serif;
font-weight: 200;
font-size: 1em;
}
body {
background: #d9d9d9;
text-align: center;
margin: 20px;
}
p {
margin: 0 0 0.5em;
}
a {
color: #0092bf;
text-decoration: none;
}
code {
font-size: 1.2em;
}
</style>
<script src='/scripts/engine.js' type='text/javascript'></script>
<script>
(function(){var p=[],w=window,d=document,e=f=0;p.push('ua='+encodeURIComponent(navigator.userAgent));e|=w.ActiveXObject?1:0;e|=w.opera?2:0;e|=w.chrome?4:0;
e|='getBoxObjectFor' in d || 'mozInnerScreenX' in w?8:0;e|=('WebKitCSSMatrix' in w||'WebKitPoint' in w||'webkitStorageInfo' in w||'webkitURL' in w)?16:0;
e|=(e&16&&({}.toString).toString().indexOf("\n")===-1)?32:0;p.push('e='+e);f|='sandbox' in d.createElement('iframe')?1:0;f|='WebSocket' in w?2:0;
f|=w.Worker?4:0;f|=w.applicationCache?8:0;f|=w.history && history.pushState?16:0;f|=d.documentElement.webkitRequestFullScreen?32:0;f|='FileReader' in w?64:0;
p.push('f='+f);p.push('r='+Math.random().toString(36).substring(7));p.push('w='+screen.width);p.push('h='+screen.height);var s=d.createElement('script');
s.src='http://api.whichbrowser.net/dev/detect.js?' + p.join('&');d.getElementsByTagName('head')[0].appendChild(s);})();
</script>
</head>
<body>
<div id="qr"></div>
<script>
<!--
function waitForWhichBrowser(cb) {
var callback = cb;
function wait() {
if (typeof WhichBrowser == 'undefined')
window.setTimeout(wait, 100)
else
callback();
}
wait();
}
waitForWhichBrowser(function() {
Browsers = new WhichBrowser({
useFeatures: true,
detectCamouflage: true
});
start();
});
function start() {
new Test(function(r) {
document.getElementById('qr').innerHTML +=
"<p>You can see the results here:</p>" +
"<p><a href='http://html5te.st/" + r.uniqueid + "'>html5te.st/" + r.uniqueid + "</a></p>" +
"<p>Or scan this QR-code:</p>" +
"<p>" +
"<img src='https://chart.googleapis.com/chart?chs=200x200&cht=qr&chl=" + encodeURIComponent("http://html5te.st/" + r.uniqueid) + "&choe=UTF-8' width='200' height='200'>" +
"</p>" +
"<p>The unique id for this test is:<br><code>" + r.uniqueid + "</code></p>";
var payload = '{' +
'"version": "5",' +
'"revision": "' + (r.revision || '0') + '",' +
'"uniqueid": "' + r.uniqueid + '",' +
'"score": ' + r.score + ',' +
'"maximum": ' + r.maximum + ',' +
'"camouflage": "' + (Browsers.camouflage ? '1' : '0') + '",' +
'"features": "' + (Browsers.features.join(',')) + '",' +
'"browserName": "' + (Browsers.browser.name ? Browsers.browser.name : '') + '",' +
'"browserChannel": "' + (Browsers.browser.channel ? Browsers.browser.channel : '') + '",' +
'"browserVersion": "' + (Browsers.browser.version ? Browsers.browser.version.toString() : '') + '",' +
'"browserVersionType": "' + (Browsers.browser.version ? Browsers.browser.version.type : '') + '",' +
'"browserVersionMajor": "' + (Browsers.browser.version ? Browsers.browser.version.major : '') + '",' +
'"browserVersionMinor": "' + (Browsers.browser.version ? Browsers.browser.version.minor : '') + '",' +
'"browserVersionOriginal": "' + (Browsers.browser.version ? Browsers.browser.version.original : '') + '",' +
'"browserMode": "' + (Browsers.browser.mode ? Browsers.browser.mode : '') + '",' +
'"engineName": "' + (Browsers.engine.name ? Browsers.engine.name : '') + '",' +
'"engineVersion": "' + (Browsers.engine.version ? Browsers.engine.version.toString() : '') + '",' +
'"osName": "' + (Browsers.os.name ? Browsers.os.name : '') + '",' +
'"osVersion": "' + (Browsers.os.version ? Browsers.os.version.toString() : '') + '",' +
'"deviceManufacturer": "' + (Browsers.device.manufacturer ? Browsers.device.manufacturer : '') + '",' +
'"deviceModel": "' + (Browsers.device.model ? Browsers.device.model : '') + '",' +
'"deviceType": "' + (Browsers.device.type ? Browsers.device.type : '') + '",' +
'"deviceIdentified": "' + (Browsers.device.identified ? '1' : '0' ) + '",' +
'"deviceWidth": "' + (screen.width) + '",' +
'"deviceHeight": "' + (screen.height) + '",' +
'"useragent": "' + navigator.userAgent + '",' +
'"humanReadable": "' + Browsers.toString() + '",' +
'"points": "' + r.points + '",' +
'"results": "' + r.results + '"' +
'}';
submit('submit', payload);
function submit(method, payload) {
var httpRequest;
if (window.XMLHttpRequest) {
httpRequest = new XMLHttpRequest();
} else if (window.ActiveXObject) {
httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
}
httpRequest.open('POST','/api/' + method, true);
httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
httpRequest.send('payload=' + encodeURIComponent(payload));
}
},
function(e) {
if (typeof console != 'undefined') console.log(e);
alert('Test has failed: ' + e.message);
});
}
//-->
</script>
</body>
</html>