[javascript] Detect flash installed
ref http://www.xs4all.nl/~ppk/js/flash.html
1<SCRIPT LANGUAGE="Javascript">
2<!--
3
4var flashinstalled = 0;
5var flashversion = 0;
6MSDetect = "false";
7if (navigator.plugins && navigator.plugins.length)
8{
9 x = navigator.plugins["Shockwave Flash"];
10 if (x)
11 {
12 flashinstalled = 2;
13 if (x.description)
14 {
15 y = x.description;
16 flashversion = y.charAt(y.indexOf('.')-1);
17 }
18 }
19 else
20 flashinstalled = 1;
21 if (navigator.plugins["Shockwave Flash 2.0"])
22 {
23 flashinstalled = 2;
24 flashversion = 2;
25 }
26}
27else if (navigator.mimeTypes && navigator.mimeTypes.length)
28{
29 x = navigator.mimeTypes['application/x-shockwave-flash'];
30 if (x && x.enabledPlugin)
31 flashinstalled = 2;
32 else
33 flashinstalled = 1;
34}
35else
36 MSDetect = "true";
37
38// -->
39</SCRIPT>
40
41<SCRIPT LANGUAGE="VBScript">
42
43on error resume next
44
45If MSDetect = "true" Then
46 For i = 2 to 6
47 If Not(IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & i))) Then
48
49 Else
50 flashinstalled = 2
51 flashversion = i
52 End If
53 Next
54End If
55
56If flashinstalled = 0 Then
57 flashinstalled = 1
58End If
59
60</SCRIPT>
2<!--
3
4var flashinstalled = 0;
5var flashversion = 0;
6MSDetect = "false";
7if (navigator.plugins && navigator.plugins.length)
8{
9 x = navigator.plugins["Shockwave Flash"];
10 if (x)
11 {
12 flashinstalled = 2;
13 if (x.description)
14 {
15 y = x.description;
16 flashversion = y.charAt(y.indexOf('.')-1);
17 }
18 }
19 else
20 flashinstalled = 1;
21 if (navigator.plugins["Shockwave Flash 2.0"])
22 {
23 flashinstalled = 2;
24 flashversion = 2;
25 }
26}
27else if (navigator.mimeTypes && navigator.mimeTypes.length)
28{
29 x = navigator.mimeTypes['application/x-shockwave-flash'];
30 if (x && x.enabledPlugin)
31 flashinstalled = 2;
32 else
33 flashinstalled = 1;
34}
35else
36 MSDetect = "true";
37
38// -->
39</SCRIPT>
40
41<SCRIPT LANGUAGE="VBScript">
42
43on error resume next
44
45If MSDetect = "true" Then
46 For i = 2 to 6
47 If Not(IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & i))) Then
48
49 Else
50 flashinstalled = 2
51 flashversion = i
52 End If
53 Next
54End If
55
56If flashinstalled = 0 Then
57 flashinstalled = 1
58End If
59
60</SCRIPT>