I know this can be done in IE by creating an ActiveX object, but how do I do it in FF. The navigator.plugins['Adobe Acrobat'] object lets me know if it's installed or not, but it doesn't contain the version number. Any ideas?
相关问题
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- void before promise syntax
- Keeping track of variable instances
- Can php detect if javascript is on or not?
http://www.pinlady.net/PluginDetect/AdobeReaderDetect.htm
navigator.plugins[n].name
wheren
is the index of the Acrobat plugin is supposed have the version number in it. Unfortunately, starting with Adobe Reader 8, they changed the name to"Adobe PDF Plug-In for Firefox and Netscape"
, with no version information. So, if this is the name you've detected at least Reader 8, but can't tell versions 8 from 9.Also, make sure you take into account that Macs don't need Acrobat Reader to render PDF files. (I booted my Windows partition just to test this.)
It should be possible to do this like swfobject detects flash version:
SWFObject source code
This script detects the reader in all browsers - even detects Chrome's PDF Reader...
Acrobat Detection Javascript code