如何从链接在特定浏览器中打开特定 URL? [英] How to open a specific URL in a specific browser from a link?
问题描述
即使 IE 是我们的默认浏览器,我们也希望用户在 Firefox 中打开来自电子邮件通知的链接.
Even though IE is our default browser we want users to open links from email notifications in Firefox.
所以我尝试了:
<a href="file:///C:Program Files (x86)Mozilla Firefoxfirefox.exe">Click me!</a>
效果很好,但是当我尝试将 URL 传递给它时却没有:
which works just fine, but when I try to pass the URL onto it it doesn't:
<a href="file:///C:Program Files (x86)Mozilla Firefoxfirefox.exe google.com">Click me!</a>
我错过了什么?
推荐答案
从 URL 中,您无法定位到特定的浏览器.这是客户端首选项,而不是您可以在 URI 中指定的内容.
From a URL, you can't target a specific browser. That's a client preference and not something that you can specify in a URI.
顺便说一句,file://
方案只是让您在浏览器中打开本地资源,而不能执行应用程序.图片点击:
BTW, the file://
scheme is simply to allow you to open local resources in browsers, and cannot execute applications. Picture clicking on:
<a href="file:///C:/Windows/System32/command.com+%2Fc+"format+C:+/Q"">Click me, I'm cool!</a>
如果您想要这种控制,您必须实现(并推出)您自己的架构机制.即使 firefox://http/somesite.com/foo/bar.htm
绑定到专门使用 Firefox.
If you want that kind of control, you'd have to implement (and roll out) your own schema mechanism. i.e. making firefox://http/somesite.com/foo/bar.htm
bind to using Firefox specifically.
这篇关于如何从链接在特定浏览器中打开特定 URL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!