Detect FLASH plugin crashes(检测 FLASH 插件崩溃)
问题描述
有没有办法通过javascript检测主流浏览器(firefox,即chrome、safari和opera)中的flash插件崩溃?
Is there any way to detect flash-plugin crashes in major browsers (firefox, ie, chrome, safari and opera) via javascript?
推荐答案
我不确定这是否有效.您可以定期获取对 flash 对象的引用,并检查它是否具有 SetVariable 方法.
I'm not sure whether that works or not. You can periodically get a reference to flash object and check whether it has the method 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 代码中调用的接口函数.如果 flash 崩溃了,它的界面也应该崩溃.因此,这可能是一个解决方案.
SetVariable is an interface function that can be called from Javascript code. If flash crashes, its interface should crash, too. Hence, that may be a solution.
这篇关于检测 FLASH 插件崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:检测 FLASH 插件崩溃


基础教程推荐
- 当用户滚动离开时如何暂停 youtube 嵌入 2022-01-01
- 动态更新多个选择框 2022-01-01
- 悬停时滑动输入并停留几秒钟 2022-01-01
- 在for循环中使用setTimeout 2022-01-01
- 在 JS 中获取客户端时区(不是 GMT 偏移量) 2022-01-01
- 有没有办法使用OpenLayers更改OpenStreetMap中某些要素 2022-09-06
- Karma-Jasmine:如何正确监视 Modal? 2022-01-01
- 响应更改 div 大小保持纵横比 2022-01-01
- 我什么时候应该在导入时使用方括号 2022-01-01
- 角度Apollo设置WatchQuery结果为可用变量 2022-01-01