How to determine the version of Adobe Acrobat installed in Firefox via JavaScript

I know that this can be done in IE by creating an ActiveX object, but how to do it in FF. The navigator.plugins ['Adobe Acrobat'] object lets you know if it is installed or not, but it does not contain a version number. Any ideas?

+3
source share
6 answers

navigator.plugins[n].name, where nis the Acrobat plugin index, must have a version number in it. Unfortunately, starting with Adobe Reader 8, they changed their name to "Adobe PDF Plug-In for Firefox and Netscape", without version information. So, if this is the name that you have discovered at least Reader 8, but cannot say version 8 of 9.

, , , Mac Acrobat Reader PDF . ( Windows, .)

+10

This should be possible, since swfobject detects the flash version:

source code SWFObject

+2
source
var p = document.getElementById('Pdf1');
//p.GetVersions()
if(p.GetVersions().indexOf("7.0") != -1)
    alert("Acrobat 7 Found")
0
source

This script detects the reader in all browsers - even detects the Chrome PDF Reader ...

Acrobat Detection Javascript code

0
source
var browser_info = {
    name: null,
    acrobat : null,
    acrobat_ver : null
  };


if(navigator.plugins != null)
  {      
   var acrobat = navigator.plugins['Adobe Acrobat'];
   if(acrobat == null)
   {           
    browser_info.acrobat = null;
    return browser_info;
   }
   browser_info.acrobat = "installed";
   browser_info.acrobat_ver = parseInt(acrobat.version[0]);                   
  }


where navigator is the property of Window
0
source

Source: https://habr.com/ru/post/1698072/


All Articles