Discussion:
Plugin-Detection
(too old to reply)
Spaceman007
2004-02-13 08:27:50 UTC
Permalink
Hi everyone...

I am about to get nuts!

I need a plugin-detection vor Acrobat Reader. Well, that would not be a big
deal but somehow, I am strugling with it.

The html-File on the bottom of this message is a summary of the script that
I have. when I test it local, meaning starting it on the filesystem, it
works fine.
=> acrobat is ok(true) and flash is ok(true). just like it is supposed to
be.
BUT, when I test it on a server, (localhost or any other one) acrobat will
be "false" no clue why.

Does anyone have an idea? - How do you guys check the Acrobad Reader Plugin?
Is there a better methode?

I thought abouot the security setting of the internet explorer, but this is
not possible since the flash plugin can be detected...
It might have to do something with the Acrobat Reader Plugin itself...

Anybody faced this problem before?

Thanks a lot!

Spaceman007


-------------------------------------------------------------------

<html>
<head>
<script>
function checkPlugin(active_x_name) {
return chkie(active_x_name);
}

if( navigator.appName == "Microsoft Internet Explorer") {
document.writeln('<scr'+'ipt language="VBScript">');
document.writeln('function chkie(active_x_name)');
document.writeln('Err.Clear');
document.writeln('On Error Resume Next');
document.writeln('Dim plugin');
document.writeln('set plugin = CreateObject(active_x_name)');
document.writeln('if Err.Number <> 0 then');
document.writeln('chkie = false');
document.writeln('else');
document.writeln('chkie = true');
document.writeln('end if');
document.writeln('end function');
document.writeln('</scr'+'ipt>');
}

var acrobatOkay1 = checkPlugin( "AcroExch.Document" );
alert( "Acrobat1: " + acrobatOkay1 );

var acrobatOkay2 = checkPlugin( "PDF.PdfCtrl.1" );
alert( "Acrobat2: " + acrobatOkay2 );

var flashOkay = checkPlugin( "ShockwaveFlash.ShockwaveFlash.5" );
alert( "Flash: " + flashOkay );

</script>
</head>
</html>

----------------------------
Roland Hall
2004-02-13 12:08:41 UTC
Permalink
"Spaceman007" wrote:
: I need a plugin-detection vor Acrobat Reader. Well, that would not be a
big
: deal but somehow, I am strugling with it.

See if this will help. It works in IE6 but not sure about other browsers.
http://kiddanger.com/lab/testfor.html
--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
Spaceman007
2004-02-13 14:53:55 UTC
Permalink
Hi Roland,

yes, it works!

Thanks a lot!
Post by Roland Hall
: I need a plugin-detection vor Acrobat Reader. Well, that would not be a
big
: deal but somehow, I am strugling with it.
See if this will help. It works in IE6 but not sure about other browsers.
http://kiddanger.com/lab/testfor.html
--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation -
http://msdn.microsoft.com/downloads/list/webdev.asp
Post by Roland Hall
MSDN Library - http://msdn.microsoft.com/library/default.asp
Roland Hall
2004-02-15 11:13:59 UTC
Permalink
"Spaceman007" wrote:
: Hi Roland,
:
: yes, it works!
:
: Thanks a lot!

You're welcome. (O:=

Roland

Continue reading on narkive:
Loading...