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
152
|
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<meta name="apple-mobile-web-app-capable" content="yes">
<title>OpenLayers Browser Detection</title>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css">
<link rel="stylesheet" href="style.css" type="text/css">
<script type="text/javascript" src="browser.js"></script>
<style type="text/css">
.olControlAttribution {
bottom: 5px;
}
.tester {
margin: 3px;
}
</style>
<script type="text/javascript">
function init() {
var result = document.getElementById('result');
result.innerHTML = result.innerHTML + "Browser CodeName: " + navigator.appCodeName + '<br>';
result.innerHTML = result.innerHTML + "Browser Name: " + navigator.appName + '<br>';
result.innerHTML = result.innerHTML + "Browser Version: " + navigator.appVersion + '<br>';
result.innerHTML = result.innerHTML + "Cookies Enabled: " + navigator.cookieEnabled + '<br>';
result.innerHTML = result.innerHTML + "Platform: " + navigator.platform + '<br>';
result.innerHTML = result.innerHTML + 'User agent: ' + navigator.userAgent + '<br>';
divResult('mouse', 'click', null, result);
divResult('mouse', 'dblclick', null, result);
divResult('mouse', 'mousedown', null, result);
divResult('mouse', 'mouseup', null, result);
divResult('mouse', 'mouseover', null, result);
divResult('mouse', 'mousemove', null, result);
divResult('mouse', 'mouseout', null, result);
divResult('key', 'keypress', null, result);
divResult('key', 'keydown', null, result);
divResult('key', 'keyup', null, result);
divResult('HTML', 'load', null, result);
divResult('HTML', 'unload', window, result);
divResult('HTML', 'abort', null, result);
divResult('HTML', 'error', null, result);
divResult('view', 'resize', window, result);
divResult('view', 'scroll', null, result);
divResult('form', 'submit', null, result);
divResult('form', 'reset', null, result);
divResult('form control', 'select', null, result);
divResult('form control', 'change', null, result);
divResult('activation', 'focus', null, result);
divResult('activation', 'blur', null, result);
divResult('touch', 'touchstart', null, result);
divResult('touch', 'touchend', null, result);
divResult('touch', 'touchmove', null, result);
divResult('touch', 'touchcancel', null, result);
divResult('gesture', 'gesturestart', null, result);
divResult('gesture', 'gesturechange', null, result);
divResult('gesture', 'gestureend', null, result);
divResult('HTML5', 'hashchange', document.body, result);
divResult('HTML5', 'online', document.body, result);
divResult('HTML5', 'offline', document.body, result);
divResult('HTML5', 'message', window, result);
divResult('HTML5', 'undo', document.body, result);
divResult('HTML5', 'redo', document.body, result);
divResult('HTML5', 'storage', window, result);
divResult('HTML5', 'popstate', window, result);
divResult('HTML5', 'canplay', document.createElement('video'), result);
divResult('HTML5', 'seeking', document.createElement('video'), result);
divResult('HTML5', 'seekend', document.createElement('video'), result);
divResult('orientation', 'deviceorientation', window, result);
divResult('orientation', 'mozorientation', window, result);
divResult('orientation', 'devicemotion', window, result);
}
</script>
</head>
<body onload="init()">
<h1 id="title">Browser detection</h1>
<div id="tags">
browser, vendor, mobile, events, HTML5, gesture, touch
</div>
<p id="shortdesc">
The goal of this script is to inform about the capacity of the browser used by the user.
</p>
<div id="docs">
<p>
See the <a href="browser.js" target="_blank">
browser.js source</a> to see how this is done.
</p>
</div>
<h1>Your browser information</h1>
<div id="result">
</div>
<h1>Click or touch the red square to get information about the selected events</h1>
<div>
<div class="tester">
<INPUT TYPE=CHECKBOX ID="clickID" checked>click<BR>
<INPUT TYPE=CHECKBOX ID="dblclickID">dblclick<BR>
<INPUT TYPE=CHECKBOX ID="mousedownID">mousedown<BR>
<INPUT TYPE=CHECKBOX ID="mouseupID">mouseup<BR>
<INPUT TYPE=CHECKBOX ID="mouseoverID">mouseover<BR>
<INPUT TYPE=CHECKBOX ID="mousemoveID">mousemove<BR>
<INPUT TYPE=CHECKBOX ID="mouseoutID">mouseout<BR>
<INPUT TYPE=CHECKBOX ID="touchstartID">touchstart<BR>
<INPUT TYPE=CHECKBOX ID="touchendID">touchend<BR>
<INPUT TYPE=CHECKBOX ID="touchmoveID">touchmove<BR>
<INPUT TYPE=CHECKBOX ID="touchcancelID">touchcancel<BR>
<INPUT TYPE=CHECKBOX ID="gesturestartID">gesturestart<BR>
<INPUT TYPE=CHECKBOX ID="gesturechangeID">gesturechange<BR>
<INPUT TYPE=CHECKBOX ID="gestureendID">gestureend<BR>
</div>
<div style="height: 200px;width: 200px;" class="tester">
<div id="box" style="height: 200px; width: 200px; background: none repeat scroll 0% 0% red; "
onclick="click(event)"
ondblclick="dblclick(event)"
onmousedown="mousedown(event)"
onmouseup="mouseup(event)"
onmouseover="mouseover(event)"
onmousemove="mousemove(event)"
onmouseout="mouseout(event)"
ontouchstart="touchstart(event)"
ontouchend="touchend(event)"
ontouchmove="touchmove(event)"
ontouchcancel="touchcancel(event)"
ongesturestart="gesturestart(event)"
ongesturechange="gesturechange(event)"
ongestureend="gestureend(event)">
</div>
</div>
<div id="log" class="tester"></div>
</div>
</body>
</html>
|