Solved

Acrobat detection

Posted on 2001-06-14
8
510 Views
Last Modified: 2013-11-18
This seems so easy but I can't figure it out!

I am looking for a script that will detect if a user has the Adobe Acrobat Reader plugin installed.  If they do not have it, i need the script to display a message and a link for them to get it.  Any help would be great.  
0
Comment
Question by:lazerproguy
8 Comments
 
LVL 15

Expert Comment

by:a.marsh
ID: 6192895
You can use this code:

if (navigator.plugins["LiveAudio"]){
  document.write("You have the LiveAudio plugin");
}
else{
  document.write("You do not have the LiveAudio plugin");
}


Only thing is I can't remember what the string is for Acrobat!

I'll see if I can find out.

Ant
0
 
LVL 15

Expert Comment

by:a.marsh
ID: 6192936
Here you go!

<html>
<head>
<script language="javascript">
<!--

if (navigator.plugins["Adobe Acrobat"]){
 document.write("You have the Adobe Acrobat plugin");
}
else{
 document.write("You do not have the Adobe Acrobat plugin");
}

//-->
</script>
</head>
<body>
</body>
</html>

:o)

Ant
0
 
LVL 15

Expert Comment

by:liebrand
ID: 6193071
Unfortunately, that only works on Netscape


0
 
LVL 15

Accepted Solution

by:
a.marsh earned 75 total points
ID: 6193103
You're right - the best cross browser I can get so far is:

<html>
<head>
<SCRIPT LANGUAGE="VBScript">
<!--
   on error resume next
   useAcrobat = not IsNull(CreateObject("AcroExch.Document"))

//-->      
</SCRIPT>
<script language="javascript">
<!--

if (navigator.plugins["Adobe Acrobat"] || useAcrobat){
document.write("You have the Adobe Acrobat plugin");
}
else{
document.write("You do not have the Adobe Acrobat plugin");
}

//-->
</script>
</head>
<body>
</body>
</html>


But you might get a security warning in IE.

Ant
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 3

Expert Comment

by:yas022100
ID: 6193209
I got this snippet...

<script language=javascript>
var isInstalled = isControlInstalled("Adobe Acrobat", "AcroExch.Document")

if (isInstalled == 0) alert("never know")
else if (isInstalled == 1) alert("yup, installed")
else alert("nope")

function isControlInstalled(strName, strProgID) {
   var isInstalled
   if (document.layers) {
       // NN
       return isPlugin(strName)
   }
   else if (document.all) {
       // IE
       return isActiveXObject(strProgID)
   }
   else {
       // other browser
       return 0
   }
}

// doesn't work with IE
function isPlugin(strPluginName) {
   for (i = 0; i < navigator.plugins.length; i++) {
       if (navigator.plugins[i].name == strPluginName) return 1
   }
   return 2
}

// return values: 0=unknown, 1=true, 2=false
function isActiveXObject(strProgID) {
   try {
       // should be installed at any rate
       obj = new ActiveXObject("InternetExplorer.Application")
       obj = null
   }
   catch(e) {
       // but ActiveX and or Scripting is disabled
       // that doesn't mean that strProgID isn't installed...
       return 0
   }
   try {
       obj = new ActiveXObject(strProgID)
       obj = null
       // strProgID is installed
       return 1
   }
   catch(e) {
       // strProgID is not installed
       return 2
   }
}
</script>
0
 

Author Comment

by:lazerproguy
ID: 6202236
Thanks a lot, I think I'll be able to work with this.
0
 

Author Comment

by:lazerproguy
ID: 6202311
Thanks a lot, I think I'll be able to work with this.
0
 

Author Comment

by:lazerproguy
ID: 6202312
Thanks a lot, I think I'll be able to work with this.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Before we dive into the marketing strategies involved with creating an effective homepage, it’s crucial that EE members know what a homepage is. In essence, a homepage is the introductory, or default page, of a website that typically highlights the …
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now