-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathon.js
More file actions
44 lines (34 loc) · 1.02 KB
/
on.js
File metadata and controls
44 lines (34 loc) · 1.02 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
DNT = () => {
if (navigator.doNotTrack) {
return navigator.doNotTrack
} else if (navigator.msDoNotTrack) {
return navigator.msDoNotTrack
} else if (window.doNotTrack) {
return window.doNotTrack
} else {
return "unknown"
}
};
// if type doesnt exist or undefined go for effectivetype
console.log(DNT());
var connection = window.navigator.connection ||
window.navigator.mozConnection ||
null;
if (connection === null) {
console.log('No support')
} else {
console.log('^ ^');
var type = navigator.connection.effectiveType;
var max = navigator.connection.downlink;
var rtt = navigator.connection.rtt;
var sd = navigator.connection.saveData;
console.log(type);
console.log(max);
console.log(rtt);
console.log(sd);
}
// New canvas stuff
var canvas = document.getElementById('canv');
var gl = canvas.getContext('webgl2');
var sync = gl.fenceSync(gl.SYNC_GPU_COMMANDS_COMPLETE, 0);
console.log(gl.getSyncParameter(sync, gl.SYNC_STATUS));