Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Flashが使えるかどうかの判定js
function FlashPlayerVer() {
var flashplayer_ver = 0;
if(navigator.plugins && navigator.mimeTypes['application/x-shockwave-flash']){
var plugin = navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin;
if(plugin){
flashplayer_ver = parseInt(plugin.description.match(/\d+\.\d+/));
}
} else {
try{
var flashOCX = new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version").match(/([0-9]+)/);
if(flashOCX){
flashplayer_ver = parseInt(flashOCX[0]);
}
}catch(e){}
}
if(flashplayer_ver <= 6){
flashplayer_ver = 0;
}
return flashplayer_ver;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment