本文介紹了檢測 FLASH 插件崩潰的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
限時送ChatGPT賬號..
有沒有辦法通過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 插件崩潰的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!