Created
August 31, 2011 10:54
-
-
Save btspoony/1183293 to your computer and use it in GitHub Desktop.
JavaScript Detect Flash Version
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.getFlashVersion = 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'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.getFlashVersion = function(){try{try{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];}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';} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment