Skip to content

Instantly share code, notes, and snippets.

@jsoizo
Created March 22, 2014 02:18
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 jsoizo/9700142 to your computer and use it in GitHub Desktop.
Save jsoizo/9700142 to your computer and use it in GitHub Desktop.
(function(){
var getFlashPlayerVersion = function() {
//[All] Flash Player is NOT installed.
var version = 0;
var tmp = [];
try {
//[IE] Flash Player is installed.
var fo = new ActiveXObject('ShockwaveFlash.ShockwaveFlash');
tmp = fo.GetVariable("$version").match(/([0-9]+)/);
version = tmp[0];
} catch (e) {
if( navigator.mimeTypes ["application/x-shockwave-flash"] !== undefined ) {
if( navigator.plugins && navigator.mimeTypes.length ) {
//[Other Browser] Flash Player is installed.
tmp = navigator.plugins["Shockwave Flash"].description.match(/([0-9]+)/);
version = tmp[0];
}
}
}
return version;
};
var version = getFlashPlayerVersion();
if (version) {
alert ("Flash Player v"+version+"is installed!");
} else {
alert ("Flash Player is not installed.");
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment