-
Notifications
You must be signed in to change notification settings - Fork 16
/
m.js
57 lines (37 loc) · 1.4 KB
/
m.js
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
_uacct = "UA-2223138-1";
urchinTracker();
function onLoad() {
var version = getSilverlightVersion();
if (version) { __utmSetVar(version); }
}
function getSilverlightVersion() {
var version = 'No Silverlight';
var container = null;
try {
var control = null;
if (window.ActiveXObject) {
control = new ActiveXObject('AgControl.AgControl');
}
else {
if (navigator.plugins['Silverlight Plug-In']) {
container = document.createElement('div');
document.body.appendChild(container);
container.innerHTML= '<embed type="application/x-silverlight" src="data:," />';
control = container.childNodes[0];
}
}
if (control) {
if (control.isVersionSupported('5.0')) { version = 'Silverlight/5.0'; }
else if (control.isVersionSupported('4.0')) { version = 'Silverlight/4.0'; }
else if (control.isVersionSupported('3.0')) { version = 'Silverlight/3.0'; }
else if (control.isVersionSupported('2.0')) { version = 'Silverlight/2.0'; }
else if (control.isVersionSupported('1.0')) { version = 'Silverlight/1.0'; }
}
}
catch (e) { }
if (container) {
document.body.removeChild(container);
}
return version;
}
onLoad();