有没有办法检测Flash阻止程序?

gar*_*uan 6 javascript flash plugins

我想知道是否有一种Javascript方式来检测用户是否安装了任何类型的闪存阻塞插件,这样我就可以正确地容纳这些用户.

例如,我使用'click to flash',但是使用SiFR渲染文本的网站上散布着"点击闪存"按钮,这非常烦人.因此我不在设计中使用SiFR.但是,如果我能够发现安装了闪存阻塞插件,我就不会调用SiFR功能.

有任何想法吗?

Nat*_*usa 5

请查看http://www.adobe.com/support/flash/publishexport/scriptingwithflash/scriptingwithflash_03.html.页面加载后,您可以调用以下内容.

var movie = window.document.movie;
try {
    //if the movie is blocked then PercentLoaded() should through an exception
    if (movie.PercentLoaded() > 0) {
        //Movie loaded or is loading
    }
}
catch (e) {
    //Movie is blocked
}
Run Code Online (Sandbox Code Playgroud)