gpt4 book ai didi

javascript - 检测 FLASH 插件崩溃

转载 作者:数据小太阳 更新时间:2023-10-29 04:09:35 29 4
gpt4 key购买 nike

有什么方法可以通过 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/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com