简体   繁体   English

单线JavaScript检测是否安装了flash

[英]One-liner JavaScript to detect if flash is installed

I know there are a bunch of posts asking this question, but all of the answers point to either swfobject or the flash detection kit.我知道有很多帖子在问这个问题,但所有答案都指向 swfobject 或 flash 检测套件。

Is there a simple one or two liner in JavaScript just to check if Flash is installed or not? JavaScript 中是否有一个简单的一个或两个衬垫只是为了检查 Flash 是否安装? I don't want to have to include a whole js library if there's an simple way to do this.如果有一种简单的方法可以做到这一点,我不想包含整个 js 库。

As a summary of the above comments as requested:作为要求的上述评论的摘要:

The following SO answer is applicable: How can I detect if Flash is installed and if not, display a hidden div that informs the user?以下 SO 答案适用: 如何检测是否安装了 Flash,如果未安装,则显示通知用户的隐藏 div?

Especially the comments / discussion of the above question are useful.特别是对上述问题的评论/讨论很有用。 I only remember that when we have used a Flash check we had combined two checks for some reasons I cannot recall.我只记得当我们使用 Flash 检查时,由于某些我不记得的原因,我们合并了两个检查。 This was prior the iPad age, nowadays I'd check against the common [x]Pads if these are among the target audience.这是在 iPad 时代之前,现在我会检查常见的 [x] 垫是否属于目标受众。 Maybe you combine the Flash and Browser check, eg once you know the browser is SAFARI/iPad you know it is not supporting Flash.也许您结合了 Flash 和浏览器检查,例如,一旦您知道浏览器是 SAFARI/iPad,您就知道它不支持 Flash。

Try to encapsulate the check so you can change / extend it if required (that was useful for us).尝试封装检查,以便您可以根据需要更改/扩展它(这对我们很有用)。

http://www.featureblend.com/flash_detect_1-0-4/flash_detect.js http://www.featureblend.com/flash_detect_1-0-4/flash_detect.js

I know you've seen it before;我知道你以前见过; that's because it works.那是因为它有效。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM