有没有办法让 Internet Explorer 中的 link 在新浏览器(Chrome / FireFox 等)中打开?

Is there a way to have a link in Internet Explorer that opens in a new browser (Chrome / FireFox / etc.)?

我认为我的主题清楚地说明了我的问题,但还有更多信息:

  1. 这是一个内部应用程序,因此我们可以完全控制用户的工作站,可以关闭弹出窗口阻止等

  2. 他们必须在 Internet Explorer 中启动。我知道 Firefox 有一些很好的插件可以在其他浏览器中打开 links,但不幸的是它们不会在 Firefox 中启动。

  3. 我更喜欢一种不需要用户做任何事情的解决方案,只需单击有问题的 link,但如有必要,可以进行某种右键单击 -> select 新的浏览器解决方案(就像我看过的一些 FireFox 插件一样)就可以了。

我们目前正在 PHP / JavaScript / HTML.

中编写所有代码

您可以使用 ActiveX。

在这种情况下,用户所要做的就是同意警告:

An ActiveX control on this page might be unsafe to interact with other parts of the page. Do you want to allow this interaction?

此外,用户需要明确允许您的页面 运行 ActiveX 脚本。 (在安全设置中允许。默认情况下未设置

如果用户允许,您可以使用 ActiveX 对象 WScript.shell,以 运行 客户端机器中的命令。调用目标浏览器的 .exe ,将要打开的页面作为第一个参数传递(有效,至少在 firefox 和 chrome 中有效):

//Works only if opening from IE:

document.querySelector("input").onclick = function() {
  var objShell = new ActiveXObject("WScript.shell");
  objShell.run('"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" "http://www.google.com/"');
};
<input type="button" value="Teste" />