-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhandle.js
More file actions
41 lines (39 loc) · 1.16 KB
/
handle.js
File metadata and controls
41 lines (39 loc) · 1.16 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
function onLoad() {
var version = getSilverlightVersion();
}
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();