检测FLASH插件崩溃 [英] Detect FLASH plugin crashes

查看:177
本文介绍了检测FLASH插件崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有什么办法通过javascript检测主要浏览器(firefox,即chrome,safari和opera)中的flash-plugin崩溃?

解决方案

div>

我不确定这是否有效。您可以定期获得对Flash对象的引用,并检查它是否具有SetVariable方法。

 函数checkFlashCrashed(){
试试{
var tmp = document.getElementById(flashObjectId)。SetVariable;
if(!tmp){
alert(Flash crashed);
return;
}
} catch(e){
alert(Flash crashed);
return;
}
setTimeout(checkFlashCrashed,1000); //每隔一秒检查一次
}

SetVariable是一个接口函数,可以是从Javascript代码调用。如果闪存崩溃,它的接口也会崩溃。因此,这可能是一个解决方案。


Is there any way to detect flash-plugin crashes in major browsers (firefox, ie, chrome, safari and opera) via javascript?

解决方案

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 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插件崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆