分类 默认分类 下的文章

管理面板
国内版
宝塔最新的免费面板:http://www.bt.cn/(国外版本 :https://aapanel.com

AMH – 4.2版免费:http://amh.sh/

WDCP 老牌免费面板:http://www.wdlinux.cn/bbs/(近来爆出严重安全漏洞)

Kangle老牌免费面板:http://www.kanglesoft.com/

自己的路 – 支持freeBSD:http://www.zijidelu.org/

国外版
VestaCP:http://vestacp.com/ (比较推荐的面板,自带中文)

Kloxo-MR:https://github.com/mustafaramadhan/kloxo/ (7.0真的很强大,很好看,很实用,有中文包)

Webmin/Virtualmin:http://www.webmin.com/virtualmin.html (很稳定,很安全,自带中文)

Ispconfig:https://github.com/dclardy64/ISPConfig-3-Debian-Installer (官网没看懂这是一键包,有中文包)

i-MSCP:http://i-mscp.net/ (简单易用,自带中文)

EasySCP:http://www.easyscp.net/ (和i-MSCP一样来自Ispconfig,自带中文)

Ajenti:http://ajenti.org/ (轻量级,类似Webmin,自带中文)

zPanel(sentora):http://www.zpanelcp.com/ http://www.sentora.org/(支持win,有中文包)

centos webpanel:http://centos-webpanel.com/ (据说比较有发展前途)

Froxlor:http://www.froxlor.org/ (很轻量的,适应各种环境)

AlternC:https://alternc.org/ (简单)

Easy Hosting Control Panel:http://ehcp.net/ (还不错的面板,有第三方汉化包)

CyberPanel面板:http://docs.cyberpanel.net/doku.php (目前只支持Centos 7.x)

宝塔英文版?http://www.aapanel.com

runcloud.io面板:https://runcloud.io (有免费版和付费版)

froxlor面板:https://www.froxlor.org/ (面板没有汉化)

一键安装包
国内版
http://lnmp.org/ (用的人很多,适应性很强)

https://oneinstack.com/ (用户也很多,博主一直使用这个)

http://teddysun.com/lamp (很好用的LAMP一键包) http://teddysun.com/lamp-yum (适合小内存≥64M)

http://bbs.aliyun.com/read/151729.html (阿里云论坛看到的)

http://blog.linuxeye.com/31.html (多种配置,软件较新)

http://lnmpp.net/ (支持postgresql,支持ARM)

http://www.hhvmc.com/thread-17-1-1.html (有hhvm的一键包)

http://shuang.ca/llnmp/ http://llsmp.cn/(有LiteSpeed的一键包)

https://www.lxconfig.com/thread-69-1-1.html (有openresty的一键包)

http://blog.7qy.com/html/1575.html (有cherokee的一键包)

http://lamp.phpstudy.net/ (有Lighttpd的一键包)

http://www.upupw.net/ (Windows平台环境搭建)

https://www.appnode.com (免费版不支持面板)

http://www.ltmp.cc/ (LTMP支持CentOS/RadHat)

http://bet.xrbk.top/ (BET面板 支持CentOS)

国外版
http://centminmod.com/ (据说很适合wordpress)

https://vpssim.com/ (很强大的一键包)

http://tuxlite.com/ (适用于Debian系列)

https://github.com/Xeoncross/lowendscript (lowendscript演变来的)

https://github.com/alexandreteles/monkeyServer(Monkey Web Server轻量级的web服务器) 作者:账号已注销 https://www.bilibili.com/read/cv20507364/

原文链接:https://segmentfault.com/a/1190000016132057

目前正在做浏览器端采用js方式实现打印这么一个功能,JS打印实现的方法很多,但是兼容各个浏览器实现打印预览的功能有些棘手,现将实现的内容及遇到的问题记录下来,希望有大牛看到所提的问题后可以给予解答,在此感谢啦。

1.JS实现打印的方式
方式一:window.print()
window.print();会弹出打印对话框,打印的是window.document.body.innerHTML中的内容,下面是从网上摘到的一个局部打印的例子,该例子的不足是打印会修改页面的内容。

<!DOCTYPE html>  
<html>  
<head>  
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />  
<title>局部打印案例</title>  
<script type="text/javascript">     
    function doPrint() {      
        bdhtml=window.document.body.innerHTML;      
        sprnstr="<!--startprint-->";      
        eprnstr="<!--endprint-->";      
        prnhtml=bdhtml.substr(bdhtml.indexOf(sprnstr)+17);      
        prnhtml=prnhtml.substring(0,prnhtml.indexOf(eprnstr));      
        window.document.body.innerHTML=prnhtml;   
        window.print();      
}      
</script>  
</head>  
  
<body>  
<p>1不需要打印的地方</p>  
<p>2这里不要打印啊</p>  
<!--startprint--><!--注意要加上html里star和end的这两个标记-->  
<h1>打印标题</h1>  
<p>打印内容~~</p>  
<!--endprint-->  
<button type="button" onclick="doPrint()">打印</button>  
<p>不打印的地方啊哈哈哈哈</p>  
<p>2</p>  
</body>  
</html>  

方式二:使用html 标签引入Webbrowser控件
这种方式是其只兼容IE,其他浏览器不可使用,同时IE10以下的浏览器才可以使用,调用方式如下:

<body>  
    <object id="WebBrowser" classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height="0" width="0"> </object>  
</body>  
<script>  
    WebBrowser.ExecWB(1,1)  //打开   
    WebBrowser.ExecWB(2,1)  //关闭现在所有的IE窗口,并打开一个新窗口   
    WebBrowser.ExecWB(4,1)  //保存网页  
    //--------------- 常用 ---------------      
    WebBrowser.ExecWB(6,1)  //打印   
    WebBrowser.ExecWB(7,1)  //打印预览   
    WebBrowser.ExecWB(8,1)  //打印页面设置   
    //-------------------------------------   
    WebBrowser.ExecWB(10,1) //查看页面属性   
    WebBrowser.ExecWB(15,1) //撤销   
    WebBrowser.ExecWB(17,1) //全选   
    WebBrowser.ExecWB(22,1) //刷新   
    WebBrowser.ExecWB(45,1) //关闭窗体无提示  
</script>  
<body>
    <object id="WebBrowser" classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height="0" width="0"> </object>
</body>
<script>
    WebBrowser.ExecWB(1,1)  //打开 
    WebBrowser.ExecWB(2,1)  //关闭现在所有的IE窗口,并打开一个新窗口 
    WebBrowser.ExecWB(4,1)  //保存网页
    //--------------- 常用 ---------------    
    WebBrowser.ExecWB(6,1)  //打印 
    WebBrowser.ExecWB(7,1)  //打印预览 
    WebBrowser.ExecWB(8,1)  //打印页面设置 
    //-------------------------------------    
    WebBrowser.ExecWB(10,1) //查看页面属性 
    WebBrowser.ExecWB(15,1) //撤销 
    WebBrowser.ExecWB(17,1) //全选 
    WebBrowser.ExecWB(22,1) //刷新 
    WebBrowser.ExecWB(45,1) //关闭窗体无提示
</script>

这种方式优势是在IE下可以弹出打印预览,这是打印很人性化的功能,但是遗憾的是高版本的IE浏览器不支持WebBrowser了

方式三:采用document.execCommand(”print”)
该方式也兼容各个版本的浏览器,同window.print()一样,其启动的是打印对话框,chrome的打印对话框自带预览功能,但是IE、火狐仅仅只弹出打印设置对话框,没有预览功能。
方式四:采用JQuery插件
使用jQuery浏览插件可以很方便的进行局部打印,常用的插件有:

1)jquery.print.js 下载地址:https://github.com/DoersGuild/jQuery.print

2)jquery.print-preview.js 下载地址:https://github.com/DoersGuild/jQuery.print

这两种方式使用都很简单,1)通过$("#id").print(/*options*/);调用;2)通过$('#id').printArea(/options/); 其中的option可选项可以在下载地址下载下来后看示例代码,一般options不用传即可,示例代码如下:

<html>  
<head>  
<meta http-equiv=Content-Type content="text/html; charset=utf-8">  
<title>JQuery打印</title>  
<script type="text/javascript" src="./js/jquery-3.1.1.min.js"></script>  
<script language="javascript" src="./js/jquery.print.js"></script>  
</head>  
  
<body style='margin:0 auto;text-align:center;'>  
<button id='button_print' name='button_print' onclick="javascript:printit()>打印</button>  
<div id='ganburenmianbaio' class=WordSection1 style='width:750px;margin:0 auto;text-align:center;vertical-align: middle;'>  
</div>  
</body>  
<script language="javascript">  
function printit(){  
    $("#ganburenmianbaio").print({iframe:true,prepend:'<br/>'});  
}  
</script>  
</html>  
<html>
<head>
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<title>JQuery打印</title>
<script type="text/javascript" src="./js/jquery-3.1.1.min.js"></script>
<script language="javascript" src="./js/jquery.print.js"></script>
</head>
 
<body style='margin:0 auto;text-align:center;'>
<button id='button_print' name='button_print' onclick="javascript:printit()>打印</button>
<div id='ganburenmianbaio' class=WordSection1 style='width:750px;margin:0 auto;text-align:center;vertical-align: middle;'>
</div>
</body>
<script language="javascript">
function printit(){
    $("#ganburenmianbaio").print({iframe:true,prepend:'<br/>'});
}
</script>
</html>

方式五:采用浏览器打印第三方插件
该方式需要用户浏览器安装相关的第三方插件,用户体验不好,故在此不细述了。

2.打印预览
chrome浏览器、win10自带的IE浏览器 调用打印弹出的打印设置界面中包含打印预览部分,故其通过上面的打印函数的调用即可实现。

IE9以后的版本、火狐不支持webbrowser控件了,JS调用不了浏览器的打印预览的功能,我们只能用iframe模拟打印预览的对话框,将需要打印的内容显示在该对话框中,然后在调用打印的功能实现打印。

1)jquery打印预览插件
jquery.print-preview.js 下载地址:https://github.com/etimbo/jquery-print-preview-plugin

其实现的效果如下图(其自动的示例代码)

2)webbrowser控件打印预览
IE8及以下版本可以调用WebBrowser.ExecWB(7,1) 函数弹出浏览器的打印预览对话框,采用该函数的好处是 用户可以在打印预览对话框中 调整页边距、页眉、页脚;

下面贴出的是设置页边距、页眉、页脚的JS代码

//取得页面打印设置的原参数数据     
function PageSetup_temp(){     
    try     
    {     
       var Wsh=new ActiveXObject("WScript.Shell");     
       HKEY_Key="header";     
        //取得页眉默认值     
       head = Wsh.RegRead(HKEY_Root+HKEY_Path+HKEY_Key);     
       HKEY_Key="footer";     
        //取得页脚默认值     
       foot = Wsh.RegRead(HKEY_Root+HKEY_Path+HKEY_Key);     
       HKEY_Key="margin_bottom";     
        //取得下页边距     
       bottom = Wsh.RegRead(HKEY_Root+HKEY_Path+HKEY_Key);     
       HKEY_Key="margin_left";     
        //取得左页边距     
       left = Wsh.RegRead(HKEY_Root+HKEY_Path+HKEY_Key);     
       HKEY_Key="margin_right";     
        //取得右页边距     
       right = Wsh.RegRead(HKEY_Root+HKEY_Path+HKEY_Key);     
       HKEY_Key="margin_top";     
        //取得上页边距     
       top = Wsh.RegRead(HKEY_Root+HKEY_Path+HKEY_Key);     
    }     
    catch(e){     
         //alert("不允许ActiveX控件");     
    }     
}  



//设置网页打印的页眉页脚和页边距,注册表里的单位是英寸,打印设置中是毫米,1英寸=25.4毫米     
function PageSetup_Null(){     
    try     
    {     
       var Wsh=new ActiveXObject("WScript.Shell");     
       HKEY_Key="header";     
        //设置页眉(为空)     
       Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"");     
       HKEY_Key="footer";     
        //设置页脚(为空)     
       Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"");     
       HKEY_Key="margin_bottom";     
        //设置下页边距(0)     
       Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"0.6");     
       HKEY_Key="margin_left";     
        //设置左页边距(0)     
       Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"0.3");     
       HKEY_Key="margin_right";     
        //设置右页边距(0)     
       Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"0.3");     
       HKEY_Key="margin_top";     
        //设置上页边距(8)     
       Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"0.6");     
    }     
    catch(e){     
         //alert("不允许ActiveX控件");     
    }     
}     
  
//设置网页打印的页眉页脚和页边距为默认值     
function PageSetup_Default(){        
    try     
    {     
       var Wsh=new ActiveXObject("WScript.Shell");     
       HKEY_Key="header";     
       HKEY_Key="header";     
        //还原页眉     
       Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,head);     
       HKEY_Key="footer";     
        //还原页脚     
       Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,foot);     
       HKEY_Key="margin_bottom";     
        //还原下页边距     
       Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,bottom);     
       HKEY_Key="margin_left";     
        //还原左页边距     
       Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,left);     
       HKEY_Key="margin_right";     
        //还原右页边距     
       Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,right);     
       HKEY_Key="margin_top";     
        //还原上页边距     
       Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,top);     
    }     
    catch(e){     
         //alert("不允许ActiveX控件");     
    }     
}  
//取得页面打印设置的原参数数据   
function PageSetup_temp(){   
    try   
    {   
       var Wsh=new ActiveXObject("WScript.Shell");   
       HKEY_Key="header";   
        //取得页眉默认值   
       head = Wsh.RegRead(HKEY_Root+HKEY_Path+HKEY_Key);   
       HKEY_Key="footer";   
        //取得页脚默认值   
       foot = Wsh.RegRead(HKEY_Root+HKEY_Path+HKEY_Key);   
       HKEY_Key="margin_bottom";   
        //取得下页边距   
       bottom = Wsh.RegRead(HKEY_Root+HKEY_Path+HKEY_Key);   
       HKEY_Key="margin_left";   
        //取得左页边距   
       left = Wsh.RegRead(HKEY_Root+HKEY_Path+HKEY_Key);   
       HKEY_Key="margin_right";   
        //取得右页边距   
       right = Wsh.RegRead(HKEY_Root+HKEY_Path+HKEY_Key);   
       HKEY_Key="margin_top";   
        //取得上页边距   
       top = Wsh.RegRead(HKEY_Root+HKEY_Path+HKEY_Key);   
    }   
    catch(e){   
         //alert("不允许ActiveX控件");   
    }   
}   



//设置网页打印的页眉页脚和页边距,注册表里的单位是英寸,打印设置中是毫米,1英寸=25.4毫米   
function PageSetup_Null(){   
    try   
    {   
       var Wsh=new ActiveXObject("WScript.Shell");   
       HKEY_Key="header";   
        //设置页眉(为空)   
       Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"");   
       HKEY_Key="footer";   
        //设置页脚(为空)   
       Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"");   
       HKEY_Key="margin_bottom";   
        //设置下页边距(0)   
       Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"0.6");   
       HKEY_Key="margin_left";   
        //设置左页边距(0)   
       Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"0.3");   
       HKEY_Key="margin_right";   
        //设置右页边距(0)   
       Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"0.3");   
       HKEY_Key="margin_top";   
        //设置上页边距(8)   
       Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"0.6");   
    }   
    catch(e){   
         //alert("不允许ActiveX控件");   
    }   
}   
 
//设置网页打印的页眉页脚和页边距为默认值   
function PageSetup_Default(){      
    try   
    {   
       var Wsh=new ActiveXObject("WScript.Shell");   
       HKEY_Key="header";   
       HKEY_Key="header";   
        //还原页眉   
       Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,head);   
       HKEY_Key="footer";   
        //还原页脚   
       Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,foot);   
       HKEY_Key="margin_bottom";   
        //还原下页边距   
       Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,bottom);   
       HKEY_Key="margin_left";   
        //还原左页边距   
       Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,left);   
       HKEY_Key="margin_right";   
        //还原右页边距   
       Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,right);   
       HKEY_Key="margin_top";   
        //还原上页边距   
       Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,top);   
    }   
    catch(e){   
         //alert("不允许ActiveX控件");   
    }   
}
使用该函数,会弹出

通过网页修改activex安全设置,添加信任站点,禁用该弹出窗口提示,代码如下:

function activeXControl(){  
        try{  
        var WshShell=new ActiveXObject("WScript.Shell");  
          
        //添加信任站点(http://127.0.0.1)  
        WshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\ZoneMap\\Ranges\\Range100\\","");  
        WshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\ZoneMap\\Ranges\\Range100\\:Range","127.0.0.1");  
        WshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\ZoneMap\\Ranges\\Range100\\http","2","REG_DWORD");  
  
        //修改IE ActiveX安全设置: 1本地Intranet区域  
        WshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\1\\1001","0","REG_DWORD");  
        WshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\1\\1004","0","REG_DWORD");  
        WshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\1\\1200","0","REG_DWORD");  
        WshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\1\\1201","0","REG_DWORD");  
        WshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\1\\1405","0","REG_DWORD");  
        WshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\1\\2201","0","REG_DWORD");  
  
        //修改IE ActiveX安全设置:2受信任的站点区域  
        WshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\2\\1001","0","REG_DWORD");  
        WshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\2\\1004","0","REG_DWORD");  
        WshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\2\\1200","0","REG_DWORD");  
        WshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\2\\1201","0","REG_DWORD");  
        WshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\2\\1405","0","REG_DWORD");  
        WshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\2\\2201","0","REG_DWORD");  
          
        //修改IE ActiveX安全设置:3Internet区域  
        WshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\3\\1001","0","REG_DWORD");  
        WshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\3\\1004","0","REG_DWORD");  
        WshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\3\\1200","0","REG_DWORD");  
        WshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\3\\1201","0","REG_DWORD");  
        WshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\3\\1405","0","REG_DWORD");  
        WshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\3\\2201","0","REG_DWORD");  
  
        //禁用Winxp弹出窗口阻止程序  
        WshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\New Windows\\PopupMgr","no");  
    }catch(e){     
         //alert("不允许ActiveX控件");     
    }     
}  
function activeXControl(){
        try{
        var WshShell=new ActiveXObject("WScript.Shell");
        
        //添加信任站点(http://127.0.0.1)
        WshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\ZoneMap\\Ranges\\Range100\\","");
        WshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\ZoneMap\\Ranges\\Range100\\:Range","127.0.0.1");
        WshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\ZoneMap\\Ranges\\Range100\\http","2","REG_DWORD");
 
        //修改IE ActiveX安全设置: 1本地Intranet区域
        WshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\1\\1001","0","REG_DWORD");
        WshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\1\\1004","0","REG_DWORD");
        WshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\1\\1200","0","REG_DWORD");
        WshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\1\\1201","0","REG_DWORD");
        WshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\1\\1405","0","REG_DWORD");
        WshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\1\\2201","0","REG_DWORD");
 
        //修改IE ActiveX安全设置:2受信任的站点区域
        WshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\2\\1001","0","REG_DWORD");
        WshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\2\\1004","0","REG_DWORD");
        WshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\2\\1200","0","REG_DWORD");
        WshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\2\\1201","0","REG_DWORD");
        WshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\2\\1405","0","REG_DWORD");
        WshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\2\\2201","0","REG_DWORD");
        
        //修改IE ActiveX安全设置:3Internet区域
        WshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\3\\1001","0","REG_DWORD");
        WshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\3\\1004","0","REG_DWORD");
        WshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\3\\1200","0","REG_DWORD");
        WshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\3\\1201","0","REG_DWORD");
        WshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\3\\1405","0","REG_DWORD");
        WshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\3\\2201","0","REG_DWORD");
 
        //禁用Winxp弹出窗口阻止程序
        WshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\New Windows\\PopupMgr","no");
    }catch(e){   
         //alert("不允许ActiveX控件");   
    }   
}

3.问题
1)网页修改activex安全设置该段代码也是必须在启用ActiveX的条件下调用成功,是需要用户在Internet的配置项中设置的(如下图),如何才能自动启用该插件?

2) chrome、火狐如何通过JS设置页边距、页眉、页脚?

3) IE高版本浏览器、火狐如何通过JS弹出浏览器自己的打印预览?

产品介绍
官网介绍

南墙WEB应用防火墙(简称:uuWAF)是有安科技推出的一款全方位网站防护产品。通过有安科技专有的WEB入侵异常检测等技术,结合有安科技团队多年应用安全的攻防理论和应急响应实践经验积累的基础上自主研发而成。协助各级政府、企/事业单位全面保护WEB应用安全,实现WEB服务器的全方位防护解决方案。

dart 技术优势
libra 先进语义引擎

南墙采用业界领先的SQL、XSS、RCE、LFI 4种基于语义分析的检测引擎,结合多种深度解码引擎可对base64、json、form-data等HTTP内容真实还原,从而有效抵御各种绕过WAF的攻击方式,并且相比传统正则匹配具备准确率高、误报率低、效率高等特点,管理员无需维护庞杂的规则库,即可拦截多种攻击类型。

ophiuchus 智能0day防御

南墙创新性的运用机器学习技术,使用异常检测算法对http正常与攻击流量进行区分识别,并对正常流量进行白名单威胁建模。通过机器学习算法自动学习正常流量中的参数特征,并转化成对应的参数白名单规则库,可以在面对各种突发0day漏洞时,无需添加规则即可拦截攻击,免除网站管理者一出现漏洞就需挑灯夜战升级的痛苦。

gemini 高级规则引擎

南墙积极运用nginx和luajit的高性能、高灵活性特点,除了提供对普通用户友好性较好的传统规则创建模式,还提供了高扩展性、高灵活性的lua脚本规则编写功能,使得有一定编程功底的高级安全管理员可以创造出一系列传统WAF所不能实现的高级漏洞防护规则,用户可以编写一系列插件来扩展WAF现有功能。从而使得在拦截一些复杂漏洞时,可以更加得心应手。

安装文档:

https://waf.uusec.com/#/guide/install