首页 > 编程 > JavaScript > 正文

js实现添加可信站点、修改activex安全设置,禁用弹出窗口阻止程序

2019-11-20 09:13:16
字体:
来源:转载
供稿:网友

为了满足将网站加入到可信站点中,使用系统的控件,在弹出窗口的时候不用提示用户。可以通过下面的方法实现:

首先,了解一下可以设置的值和含义。

可信站点的注册表项目录

HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Internet Settings/ZoneMap/Ranges/Range[*]

ActiveX控件的注册表项目录

HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Internet Settings/Zones/[0-4]/[*]

含义说明:

ActiveX 控件设置值的含义:3为禁用,0为启用,1为提示

注册表项中目录 [0-4] 的含义

设置
0 我的电脑
1 本地 Intranet 区域
2 可信的站点区域
3 Internet 区域
4 受限制的站点区域

注册表项中 [*] 的含义

设置
1001 下载已签名的 ActiveX 控件
1004 下载未签名的 ActiveX 控件
1200 运行 ActiveX 控件 和插件
1201 对没有标记为安全的 ActiveX 控件 进行初始化和脚本运行
1405 对标记为可安全执行脚本的 ActiveX 控件 执行脚本
2201 ActiveX 控件 自动提示 **

弹出窗口阻止程序的注册表项

HKEY_CURRENT_USERHKCU/Software/Microsoft/Internet Explorer/New Windows/PopupMgr

具体脚本如下:

<SCRIPT LANGUAGE="JavaScript"><!-- var WshShell=new ActiveXObject("WScript.Shell"); //添加可信站点或IP WshShell.RegWrite("HKCU//Software//Microsoft//Windows//CurrentVersion//Internet Settings//ZoneMap//Ranges//Range100//",""); WshShell.RegWrite("HKCU//Software//Microsoft//Windows//CurrentVersion//Internet Settings//ZoneMap//Ranges//Range100//http","2","REG_DWORD"); WshShell.RegWrite("HKCU//Software//Microsoft//Windows//CurrentVersion//Internet Settings//ZoneMap//Ranges//Range100//:Range","www.VeVB.COm"); WshShell.RegWrite("HKCU//Software//Microsoft//Windows//CurrentVersion//Internet Settings//ZoneMap//Ranges//Range101//",""); WshShell.RegWrite("HKCU//Software//Microsoft//Windows//CurrentVersion//Internet Settings//ZoneMap//Ranges//Range101//http","2","REG_DWORD"); WshShell.RegWrite("HKCU//Software//Microsoft//Windows//CurrentVersion//Internet Settings//ZoneMap//Ranges//Range101//:Range","www.example.com"); //修改IE ActiveX 安全设置 WshShell.RegWrite("HKCU//Software//Microsoft//Windows//CurrentVersion//Internet Settings//Zones//3//1001","0","REG_DWORD"); WshShell.RegWrite("HKCU//Software//Microsoft//Windows//CurrentVersion//Internet Settings//Zones//3//1004","0","REG_DWORD"); WshShell.RegWrite("HKCU//Software//Microsoft//Windows//CurrentVersion//Internet Settings//Zones//3//1200","0","REG_DWORD"); WshShell.RegWrite("HKCU//Software//Microsoft//Windows//CurrentVersion//Internet Settings//Zones//3//1201","0","REG_DWORD"); WshShell.RegWrite("HKCU//Software//Microsoft//Windows//CurrentVersion//Internet Settings//Zones//3//1405","0","REG_DWORD"); WshShell.RegWrite("HKCU//Software//Microsoft//Windows//CurrentVersion//Internet Settings//Zones//3//2201","0","REG_DWORD"); //禁用弹出窗口阻止程序 WshShell.RegWrite("HKCU//Software//Microsoft//Internet Explorer//New Windows//PopupMgr","no"); alert("可信站点设置,ActiveX 控件安全设置,弹出窗口设置成功");//--></SCRIPT>

比如把 www.VeVB.COm 添加到客户的可信站点

1. 打开注册表(运行regedit),首先依次打开以下的目录

HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Internet Settings/ZoneMap/Domains

2. 在目录下新建一个项:“VeVB.COm”

3. 在 VeVB.COm 下面再新建一个项:“www”

4. 在 www 下新键一个双字节子键:“*”(表示任何协议,或者设置为:“http”、“ftp”等单个协议)

5. 双击刚才新建的双字节子键“*”,确保基数里选择是“十六进制”,在数值数据种填写“2(表示可信站点)”

6. 关闭注册表

<SCRIPT LANGUAGE="JavaScript"><!-- var WshShell=new ActiveXObject("WScript.Shell"); WshShell.RegWrite("HKCU//Software//Microsoft//Windows//CurrentVersion//Internet Settings//ZoneMap//Domains//VeVB.COm",""); WshShell.RegWrite("HKCU//Software//Microsoft//Windows//CurrentVersion//Internet Settings//ZoneMap//Domains//VeVB.COm//www",""); WshShell.RegWrite("HKCU//Software//Microsoft//Windows//CurrentVersion//Internet Settings//ZoneMap//Domains//VeVB.COm//www//http","2","REG_DWORD" ); alert("成功将VeVB.COm写入到可信站点");//--></SCRIPT>

以上这篇js实现添加可信站点、修改activex安全设置,禁用弹出窗口阻止程序就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持武林网。

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表