javascript检测浏览器flash版本的实现代码


  本文标签:浏览器,flash版本

记录:
复制代码 代码如下:

(function(){
ver has=0, ver=0;
try{
has=new ActiveXObject(ShockwaveFlash.ShockwaveFlash);
if(has) {
ver = +(has.GetVariable("$version").match(/\d+/));
}
}
catch(e){
has=navigator.plugins["Shockwave Flash"];
if(has) {
ver = +(has.description.match(/\d+/));
}
}
console.log(ver);//0即无插件
})()