-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathexploder.js
95 lines (86 loc) · 3.67 KB
/
exploder.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
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
/*jslint browser: true */
/*global Pfs, PluginDetect, window*/
if (Pfs.$.browser.msie) {
window.iePlugins = [];
var alterNavigator = function (name, description, filename, mimeType) {
window.iePlugins.push({
name: name,
description: description,
filename: filename,
length: 1,
"0": {type: mimeType }
});
};
/* IE has no proper navigator.plugins, so we use the pinlady library
to detect COM objects or plugins via <object> tags.
Once we've detected an installed plugin, we set either the \
plugin name or description to the detected version.
Lastly we disable pinladyDetection which is an option for
Firefox, Opera, Safari, and Chrome */
Pfs.UI.usePinladyDetection = false;
//Bug#519823 If we want to start using Applets again
var j = PluginDetect.getVersion('Java', 'getJavaInfo.jar', [0, 0, 0]);
if (j !== null) {
alterNavigator('Java Embedding Plugin ' + j.replace(/,/g, '.').replace(/_/g, '.'),
'Runs Java applets using the latest installed versions of Java.',
'npjp2.dll',
'application/x-java-applet');
}
var f = PluginDetect.getVersion('Flash');
if (f !== null) {
alterNavigator('Shockwave Flash', 'Shockwave Flash ' + f.replace(/,/g, '.'), 'NPSWF32.dll', 'application/x-shockwave-flash');
}
var q = PluginDetect.getVersion('QuickTime');
if (q !== null) {
alterNavigator('QuickTime Plug-in ' + q.replace(/,/g, '.'),
'The QuickTime Plugin allows you to view a wide variety of multimedia content in web pages.',
'npqtplugin.dll',
'video/quicktime');
}
var w = PluginDetect.getVersion('WindowsMediaPlayer');
if (q !== null) {
alterNavigator('Windows Media Player Plug-in Dynamic Link Library',
q.replace(/,/g, '.'),
'nsdsplay.dll',
'video/x-ms-wmv');
}
var d = PluginDetect.getVersion('Shockwave');
if (d !== null) {
alterNavigator('Shockwave for Director',
d.replace(/,/g, '.'),
'np32dsw.dll',
'application/x-director');
}
var dv = PluginDetect.getVersion('DevalVR');
if (dv !== null) {
alterNavigator('DevalVR - QTVR player',
dv.replace(/,/g, '.'),
'jaronlanier.dll', // FIXME
'application/x-devalvrx');
}
var sl = PluginDetect.getVersion('Silverlight');
if (sl !== null) {
alterNavigator('Silverlight Plug-In',
sl.replace(/,/g, '.'),
'silverlight.plugin', // FIXME
'application/x-silverlight');
}
var vlc = PluginDetect.getVersion('VLC');
if (vlc !== null) {
alterNavigator('VLC Multimedia Plug-in',
vlc.replace(/,/g, '.'),
'npvlc.dll', // FIXME
'video/mp4');
}
//BrowserPlus
var browserPlusMime = 'application/x-yahoo-browserplus_2';
Pfs.$('body').append('<object id="__browserPlusPluginID" type="' + browserPlusMime + '"></object>');
var bp = Pfs.$('#__browserPlusPluginID').get(0);
if (bp && bp.Info) {
var browserPlusVersion = bp.Info().version;
alterNavigator('BrowserPlus (from Yahoo!)',
'BrowserPlus ' + browserPlusVersion,
'npybrowserplus_' + browserPlusVersion + '.dll',
browserPlusMime);
}
}