I've been charged with figuring out how to do plug-in detection for a shareware animation plug-in, and though I have it working in Javascript on Netscape, I'm having a heck of a time with the VBScript version for IE. For that reason, and the fact that I don't want to make any assumptions about the user having client-side scripting turned on, I was hoping to be able to accomplish the same thing on the server side.

First I tried checking HTTP_ACCEPT to see what media types the client was accepting, but only came up with "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */*". I guess the plug-in's MIME type is somewhere under */*...

Then I tried using the CGI.pm module, 'cuz it says (and I quote)

Accept()

Return a list of MIME types that the remote browser accepts. If you give this method a single argument corresponding to a MIME type, as in $query->Accept('text/html'), it will return a floating point value corresponding to the browser's preference for this type from 0.0 (don't want) to 1.0. Glob types (e.g. text/*) in the browser's accept list are handled correctly.
Note the capitalization of the initial letter. This avoids conflict with the Perl built-in accept().

So this is the code I used:

#!/usr/bin/perl use CGI; $q = new CGI; print $q->header(), $q->start_html(-title=>'Plug-in Detection'), $q->Accept('x-animation/x-inkmorph'); $q->end_html();

I loaded the CGI on a browser that had the plug-in and got a result of 1. Sounds great, right? It was, until I tried it on a browser that didn't have the plug-in, and I still got a result of 1.

What am I doing wrong here? Or is server-side plug-in detection simply not possible? If anyone has any ideas, please let me know. Failing that, I could use some good VBScript links. :(

Thanks,
Michelle


In reply to Server-side plug-in detection? by Soliloquy

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.