Skip to content

Instantly share code, notes, and snippets.

@flavioribeiro
Created August 25, 2015 19:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flavioribeiro/586cdfeba90454e086d1 to your computer and use it in GitHub Desktop.
Save flavioribeiro/586cdfeba90454e086d1 to your computer and use it in GitHub Desktop.
getFlashVersion: function() {
// ie
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(err) {}
}
return '0,0,0';
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment