#1
  1. No Profile Picture
    guttorm
    Guest
    Devshed Newbie (0 - 499 posts)
    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.
  2. #2
  3. No Profile Picture
    Ulf Wendel
    Guest
    Devshed Newbie (0 - 499 posts)
    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
  4. #3
  5. No Profile Picture
    guttorm
    Guest
    Devshed Newbie (0 - 499 posts)
    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?

Similar Threads

  1. Flash plugin detection
    By Chrille in forum PHP Development
    Replies: 2
    Last Post: March 31st, 2004, 04:06 PM
  2. Links to multiple destinations in pdf file.
    By Andrew Clark in forum HTML Programming
    Replies: 0
    Last Post: July 25th, 2003, 04:52 AM
  3. screen reader detection?
    By chudzikr in forum HTML Programming
    Replies: 12
    Last Post: January 19th, 2003, 02:42 PM
  4. plugin detection on MAC and UNIX/LINUX systems
    By sahib in forum HTML Programming
    Replies: 1
    Last Post: August 16th, 2002, 06:22 PM
  5. plugin detection
    By juliuspong in forum HTML Programming
    Replies: 2
    Last Post: January 17th, 2001, 04:26 AM

IMN logo majestic logo threadwatch logo seochat tools logo