-
新建txt文档
-
复制以下代码粘人txt(下面代码中的路径为IE路径)
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\openIE]
@="URL:OpenIE Protocol"
"URL Protocol"=""
[HKEY_CLASSES_ROOT\openIE\DefaultIcon]
@="iexplore.exe,1"
[HKEY_CLASSES_ROOT\openIE\shell]
[HKEY_CLASSES_ROOT\openIE\shell\open]
[HKEY_CLASSES_ROOT\openIE\shell\open\command]
@="cmd /c set m=%1 & call set m=%%m:openIE:=%% & call \"C:\\Program Files\\Internet Explorer\\iexplore.exe\" %%m%% & exit"
-
将新建的txt后缀修改为reg
-
双击reg文件
-
在页面中使用以下代码调用IE
window.location.href = "openIE:http://www.baidu.com" ;// 使用IE打开
-
调用成功谷歌浏览器会弹出下图的弹出框,如果不想每次都弹出可以将复选框选中
-
如果调取失败请检查IE安装路径
.