禁用Chrome下载栏.. [英] Disable chrome download bar..

查看:399
本文介绍了禁用Chrome下载栏..的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法为您的网络应用程序禁用Chrome下载栏?或者以编程方式安装禁用下载栏的Chrome扩展程序的方法?



我尝试了什么:



得到了这个选项chrome.downloads.setShelfEnabled(布尔启用)但除了下载权限之外它还说downloads.shelf权限。

如何设置这些使用JavaScript的权限?

Is there a way to disable the chrome download bar for your web application? Or a way to programmatically install a chrome extension that disables download bar?

What I have tried:

got this option chrome.downloads.setShelfEnabled(boolean enabled) but it says "downloads.shelf" permission in addition to the "downloads" permission.
How to set these permissions using JavaScript ?

推荐答案

试试这个:





Try this:


<script type="text/javascript">
function CheckPlugin()
{
var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
function findPlugin(ext) {
var thisExt, findExt;
for (var n = 0; n < navigator.plugins.length; n++) {
//alert("n value"+ navigator.plugins.length);
for (var m = 0; m < navigator.plugins[n].length; m++) {
//alert("m length:"+navigator.plugins[n].length);
thisExt = navigator.plugins[n][m].description.toLowerCase();
// alert("this exten"+thisExt);
findExt = thisExt.substring(0, thisExt.indexOf(" "));
//alert("findexes"+findExt);
if (findExt == ext)
return (true);
}
}
return (false);
}

if (is_chrome ==true) {
//alert("chrome browser");
if (findPlugin("acrobat")) {
//alert("Adobe Acrobat pdf viewer");
return true;
}
else {

alert("please disable the chrome pdf viewer and enable the Adobe Acrobat PDF viewer \n Please follow the steps:\n 1.Open the new tab 'chrome://plugins/' type the Address. \n 2. Click the Enable link in 'Adobe Acrobat' field. \n 3. click the Disable link in 'Chrome PDF Viewer'. \n 4. Close the tab and you can open the PDf files in chrome browser.");
return false;
}
}
else {
//alert("not chrome");
}
}

</script>


这篇关于禁用Chrome下载栏..的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆