function hasFlash function look for flag in the query string to bypass

 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
(function($$) {
$$.hasFlash = function() {
// look for a flag in the query string to bypass flash detection
if(/hasFlash\=true/.test(location)) return true;
if(/hasFlash\=false/.test(location)) return false;
var pv = $$.hasFlash.playerVersion().match(/\d+/g);
var rv = String([arguments[0], arguments[1], arguments[2]]).match(/\d+/g) || String($$.pluginOptions.version).match(/\d+/g);
for(var i = 0; i < 3; i++) {
pv[i] = parseInt(pv[i] || 0);
rv[i] = parseInt(rv[i] || 0);
// player is less than required
if(pv[i] < rv[i]) return false;
// player is greater than required
if(pv[i] > rv[i]) return true;
}
// major version, minor version and revision match exactly
return true;
};
$$.hasFlash.playerVersion = function() {
// ie
try {
try {
// avoid fp6 minor version lookup issues
// see: http://blog.deconcept.com/2006/01/11/getvariable-setvariable-crash-internet-explorer-flash-6/
var axo = new ActiveXObject('ShockwaveFlash.ShockwaveFlash.6');
try { axo.AllowScriptAccess = 'always'; }
catch(e) { return '6,0,0'; }
} catch(e) {}
return new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version').replace(/\D+/g, ',').match(/^,?(.+),?$/)[1];
// other browsers
} catch(e) {
try {
if(navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin){
return (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]).description.replace(/\D+/g, ",").match(/^,?(.+),?$/)[1];
}
} catch(e) {}
}
return '0,0,0';
};
$$.pluginOptions = {
expressInstall: false,
update: true,
version: '6.0.65'
};
})(jQuery);