Javascript 我可以强制在特定浏览器中打开链接吗?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5881383/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Can I force a link to open in a specific browser?
提问by Daniel H
I have designed a website using Firefox and am now looking to integrate a softphone into the webpage, but unfortunately it is made with ActiveX, so firefox won't support it.
我已经使用 Firefox 设计了一个网站,现在希望将软电话集成到网页中,但不幸的是它是用 ActiveX 制作的,因此 firefox 不支持它。
I have tried opening my page in IE9, and it looks a mess because I've used CSS3 for alot of it and haven't coded it for different browsers because we will only be using Firefox within the office.
我曾尝试在 IE9 中打开我的页面,但它看起来一团糟,因为我在其中使用了大量 CSS3 并且没有针对不同的浏览器对其进行编码,因为我们只会在办公室内使用 Firefox。
Is there a way that I can tell my page in Firefox to specifically open a new page in Internet Explorer and just have the softphone in there? Or is there a way to get ActiveX running in firefox with a plugin or something?
有没有一种方法可以让我在 Firefox 中告诉我的页面在 Internet Explorer 中专门打开一个新页面,然后将软件电话放在那里?或者有没有办法通过插件或其他东西让ActiveX在firefox中运行?
Thanks for any help
谢谢你的帮助
采纳答案by ariel
I don't think you can open a IE window from firefox, but you can easily build a firefox plugin based on your activex using http://code.google.com/p/ff-activex-host/
我认为您无法从 firefox 打开 IE 窗口,但是您可以使用http://code.google.com/p/ff-activex-host/基于您的 activex 轻松构建一个 firefox 插件
回答by Igor
It really depends on your exact situation.
这真的取决于你的具体情况。
If you are targeting multiple users outside a corporate network this is hardly possible to achieve. However, if you are targeting your company's network it's possible to do this using custom protocol.
如果您的目标是企业网络之外的多个用户,这几乎不可能实现。但是,如果您的目标是公司的网络,则可以使用自定义协议来执行此操作。
Your link then would look like: ie://opens_in_ie.com
您的链接将如下所示:ie://opens_in_ie.com
You'll have to make changes to registry of target computers though. More info about custom protocols is available here: http://msdn.microsoft.com/en-us/library/aa767914%28v=vs.85%29.aspx
不过,您必须更改目标计算机的注册表。有关自定义协议的更多信息,请访问:http: //msdn.microsoft.com/en-us/library/aa767914%28v=vs.85%29.aspx
In most cases, system administrator can do this remotely.
在大多数情况下,系统管理员可以远程执行此操作。
回答by Tony
IETab V2will let you open a tab within Firefox that runs the IE engine.
IETab V2将允许您在运行 IE 引擎的 Firefox 中打开一个选项卡。
Once installed, you can force a link to open with IE by formatting the URL or bookmark like this:
安装后,您可以通过像这样格式化 URL 或书签来强制使用 IE 打开链接:
chrome://ietab2/content/reloaded.html?url=http://domain.com
回答by jake_nerdnest
It's somewhat specific, but I created an internal site at work, and I wanted to link to another internal site that only works in IE. To do this, I created/defined my own application protocol in the registry. Then I added to my links the protocol header. This is similar to what apple does when you click a link and it opens iTunes. The downside to this approach, however, is that users will have to install the registry modification for it to work... like I said, it's really a solution for a very specific scenario.
它有点具体,但我在工作中创建了一个内部站点,并且我想链接到另一个只能在 IE 中工作的内部站点。为此,我在注册表中创建/定义了自己的应用程序协议。然后我将协议头添加到我的链接中。这类似于当您单击链接并打开 iTunes 时 Apple 所做的事情。然而,这种方法的缺点是用户必须安装注册表修改才能使其工作......就像我说的那样,它确实是一个非常特定场景的解决方案。