判断浏览器Flash是否被屏蔽

更新时间:19-02-20 10:45 热度:488
 

function isFlashOpen(){
var rtn = true;
var isIE = !-[1,];
if (isIE) {
try {
var swf1 = new ActiveXObject(‘ShockwaveFlash.ShockwaveFlash’);
}
catch (e) {
rtn = false;
}
}
else {
try {
var swf2 = navigator.plugins['Shockwave Flash'];
if (swf2 == undefined) {
rtn = false;
}
} catch (e) {

}
};
if(rtn==false){
alert(“您未开启Flash!”);
}else{ }

}

禁用时的效果

20190220024450997 1024x225 判断浏览器Flash是否被屏蔽