在chrome浏览器中调用IE浏览器并访问(openIE.reg自定义协议)

itlao6 工具&方法评论458字数 1548阅读5分9秒阅读模式

在谷歌浏览器中有4种方法调用IE浏览器。如下:


 文章源自IT老刘-https://itlao6.com/1619.html

  1. c++ socket通过浏览器在ie中打开指定url ;
  2. vb生成exe,url访问exe启动ie并打开指定url ;
  3. 通过socket实现通过http调用IE浏览器并打开指定url ;
  4. chrome自定义协议。

 文章源自IT老刘-https://itlao6.com/1619.html

今天我们就来说一下使用chrome自定义协议打开ie浏览器并访问指定页面。文章源自IT老刘-https://itlao6.com/1619.html

当然,有很多网友都写过,我这里就借花献佛了。文章源自IT老刘-https://itlao6.com/1619.html

使用方式:文章源自IT老刘-https://itlao6.com/1619.html

  1. 添加一个注册表;
  2. 在chrome里面用a标签编写一个跳转链接;
  3. 优化用户体验。

 文章源自IT老刘-https://itlao6.com/1619.html

添加注册表文章源自IT老刘-https://itlao6.com/1619.html

在桌面上建立一个openIE.reg(将txt改为reg)文件,点击编辑打开,在里面写入如下内容来进行自定义协议(注册表),完成后双击运行文件。文章源自IT老刘-https://itlao6.com/1619.html

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"

写完后双击运行文件。文章源自IT老刘-https://itlao6.com/1619.html


 文章源自IT老刘-https://itlao6.com/1619.html

在chrome里面用a标签编写一个跳转链接文章源自IT老刘-https://itlao6.com/1619.html

<a href="openIE:www.baidu.com">点我使用外部协议运行IE打开百度</a>文章源自IT老刘-https://itlao6.com/1619.html

这样就在chrom里面调用IE访问指定的网站。文章源自IT老刘-https://itlao6.com/1619.html

这里有个不好的用户体验,他会弹出一个黑窗窗(cmd的命令框),解决方法如下:文章源自IT老刘-https://itlao6.com/1619.html


 文章源自IT老刘-https://itlao6.com/1619.html

优化用户体验文章源自IT老刘-https://itlao6.com/1619.html

新建一个alert文件夹(协议名称)(注意:所有操作完成后alert文件夹重命名为alert.exe并双击运行)文章源自IT老刘-https://itlao6.com/1619.html

进入文件夹,建立三个文件,分别为alert.reg、openIE.bat、runreg.bat,里面写入内容如下文章源自IT老刘-https://itlao6.com/1619.html

alert.reg文章源自IT老刘-https://itlao6.com/1619.html

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\alert]
@="URL:Alert Protocol"
"URL Protocol"=""

[HKEY_CLASSES_ROOT\alert\DefaultIcon]
@="iexplore.exe,1"

[HKEY_CLASSES_ROOT\alert\shell]

[HKEY_CLASSES_ROOT\alert\shell\open]

[HKEY_CLASSES_ROOT\alert\shell\open\command]
@="cmd /c set m=%1 & \"C:\\Program Files\\alert\\openIE.bat\" %%m%% & exit"

openIE.bat文章源自IT老刘-https://itlao6.com/1619.html

@echo off
set m=%m:alert:=%
set m="%m:separator=&%"
start "" "C:\\Program Files\\Internet Explorer\\iexplore.exe" %m%
exit

runreg.bat

REGEDIT /S alert.reg

 

建立完后,将文件夹alert改为alert.exe并双击运行。这样自定义协议就完成了,然后就可以直接在chrome里面调用IE打开指定网页了。

原文地址:https://www.cnblogs.com/xiongze520/p/11684570.html

继续阅读
weinxin
我的微信公众号
微信扫一扫关注公众号,不定时更新
itlao6
  • 本文由 发表于 2019年 10月 16日 12:14:11
  • 转载请务必保留本文链接:https://itlao6.com/1619.html
评论  0  访客  0
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定