Js 检测客户端是否安装Acrobat pdf阅读器

function isAcrobatPluginInstall(){
//如果是firefox浏览器
if (navigator.plugins && navigator.plugins.length) {
for (x=0; x<navigator.plugins.length;x++) {
if (navigator.plugins[x].name== 'Adobe Acrobat')
return true;
}
}
//下面代码都是处理IE浏览器的情况
else if (window.ActiveXObject)
{
for (x=2; x<10; x++)
{
try
{
oAcro=eval_r("new ActiveXObject('PDF.PdfCtrl."+x+"');");
if (oAcro)
{
return true;
}
}
catch(e) {}
}
try
{
oAcro4=new ActiveXObject('PDF.PdfCtrl.1');
if (oAcro4)
return true;
}
catch(e) {}
try
{
oAcro7=new ActiveXObject('AcroPDF.PDF.1');
if (oAcro7)
return true;
}
catch(e) {}
}
}


你可能感兴趣的:(Js 检测客户端是否安装Acrobat pdf阅读器)