Ska*_*kay 8 javascript browser crash flash
有没有办法通过javascript检测主流浏览器(firefox,即chrome,safari和opera)中的flash-plugin崩溃?
我不确定这是否有效.您可以定期获取对flash对象的引用,并检查它是否具有SetVariable方法.
function checkFlashCrashed() {
try {
var tmp = document.getElementById("flashObjectId").SetVariable;
if(!tmp) {
alert("Flash crashed");
return;
}
} catch (e) {
alert("Flash crashed");
return;
}
setTimeout(checkFlashCrashed, 1000); // check it out every one second
}
Run Code Online (Sandbox Code Playgroud)
SetVariable是一个可以从Javascript代码调用的接口函数.如果闪存崩溃,它的界面也会崩溃.因此,这可能是一个解决方案.