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 插件崩溃


基础教程推荐
- 如何添加到目前为止的天数? 2022-01-01
- fetch 是否支持原生多文件上传? 2022-01-01
- 即使用户允许,Gmail 也会隐藏外部电子邮件图片 2022-01-01
- npm start 错误与 create-react-app 2022-01-01
- Bootstrap 模态出现在背景下 2022-01-01
- Fabric JS绘制具有活动形状的多边形 2022-01-01
- 检查 HTML5 拖放文件类型 2022-01-01
- 原生拖动事件后如何获取 mouseup 事件? 2022-01-01
- 在 contenteditable 中精确拖放 2022-01-01
- Bokeh Div文本对齐 2022-01-01