Created
March 22, 2014 02:18
-
-
Save jsoizo/9700142 to your computer and use it in GitHub Desktop.
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
(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