HTML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignHTML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 1st, 1999, 02:34 AM
guttorm
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Is there a way to detect if the browser has installed a pdf-viewer plug-in?

I have some pdf-files, and I want users requesting them redirected to a "you need the pdf-reader plug-in" page if they cannot view pdf-files.

Thanks in advance,
Guttorm.

Reply With Quote
  #2  
Old October 2nd, 1999, 07:32 AM
Ulf Wendel
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
I have no experience with it but have you tried:

plugin.description (JavaScript 1.1)
navigation.plugins (JavaScript 1.1)

plugs=navigator.plugins;
len = plugs.length;
for (i=0; i<len; i++) {
MimeType = plugs[i];
text = "Plugin "+i+" supports MimeType: '"+MimeType.type+"'";
window.alert(text)
}

Ulf

Reply With Quote
  #3  
Old October 4th, 1999, 02:27 AM
guttorm
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Thanks a lot. I was able to make a function to detect the plug-in that looks like this:

function PdfMimeOk()
{
if (navigator.appName == "Netscape") {
i = navigator.mimeTypes.length;
while (i--) {
if (navigator.mimeTypes[i].suffixes == "pdf")
return true;
}
}
return false;
}

This works fine in Netscape (therefore the check), but in Internet Explorer, the navigator.mimeTypes (as well as the navigator.plugins) arrays are always empty.

Any ideas what to do in Internet Explorer?

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignHTML Programming > detection of the pdf-reader plugin


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway