有什么方法可以通过 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
}
SetVariable 是一个可以从 Javascript 代码调用的接口(interface)函数。如果闪存崩溃,它的界面也应该崩溃。因此,这可能是一个解决方案。
关于javascript - 检测 FLASH 插件崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3329022/