Soliloquy has asked for the wisdom of the Perl Monks concerning the following question:
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Server-side plug-in detection?
by Masem (Monsignor) on May 06, 2001 at 04:00 UTC | |
by Soliloquy (Beadle) on May 07, 2001 at 01:31 UTC |