我正在使用来自http://code.google.com/p/swfobject/的swfobject.js文件。我正在尝试查看用户是否安装了Flash并处于活动状态。It is supposed to displays the version number as 0.0.0 when it is installed but disabled。当我禁用Flash时,此页面将提示0.0.0。这就是我想要的。
如果我从上面的页面复制源代码,并在我的桌面上运行它-它工作得很好。然后,我尝试使用相同的代码,但在我的IIS上,它给我提供了已安装的版本,即使它被禁用。这可能与MIME映射有关吗?
我使用了以下代码:
var playerVersion = swfobject.getFlashPlayerVersion();
var output = "You have Flash player " + playerVersion.major +
"." + playerVersion.minor + "." + playerVersion.release +
" installed";
alert(output);编辑:当我禁用Flash时,Firefox会正确地警告0.0.0。IE不需要。
发布于 2011-09-07 06:15:31
您做了一个错误的假设--当安装了闪存但未激活时,SWFObject不会声称返回0.0.0。它可能是在非IE浏览器中处理Flash Player的副产品,但它不是官方的SWFObject特性。
(You can read the swfobject.getFlashPlayerVersion API documentation here)
SWFObject会检测是否安装了Flash Player,但不会检查它是否已被用户禁用。事实上,由于浏览器实现Flash播放器插件的方式多种多样,因此几乎不可能可靠地检测用户是否禁用了Flash。同样,使用SWFObject的Flash开发人员经常遇到安装AdBlock和FlashBlock等浏览器扩展的最终用户的问题。
https://stackoverflow.com/questions/7317346
复制相似问题