如何从链接打开特定浏览器中的特定网址? [英] How to open a specific URL in a specific browser from a link?

查看:242
本文介绍了如何从链接打开特定浏览器中的特定网址?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

即使IE是我们的默认浏览器,我们希望用户在Firefox中打开电子邮件通知的链接。



所以我试过了:

 < a href =file:/// C:\程序文件(x86)\ Mozilla Firefox \ firefox.exe>点击我! < / A> 

这很好,但是当我尝试将URL传递给它时:

 < a href =file:/// C:\程序文件(x86)\ Mozilla Firefox \ firefox .exe google.com>点击我!< / a> 

我缺少什么?

解决方案

从一个URL,你不能针对特定的浏览器。这是一个客户端的偏好,而不是你可以在URI中指定的东西。



顺便说一句, file:// 方案只是让你打开浏览器的本地资源,而不能执行应用程序。点击图片:

 < a href =file:/// C:/Windows/System32/command.com+% 2Fc +& quot; format + C:+ / Q& quot;>点击我,我很酷!< / a> 

如果你想要这样的控制,你必须实现(并推出)你自己的架构机制。即使使用Firefox进行绑定。


Even though IE is our default browser we want users to open links from email notifications in Firefox.

So I tried:

<a href="file:///C:\Program Files (x86)\Mozilla Firefox\firefox.exe">Click me!</a>

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 Firefox\firefox.exe google.com">Click me!</a>

What am I missing?

解决方案

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.

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+&quot;format+C:+/Q&quot;">Click me, I'm cool!</a>

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.

这篇关于如何从链接打开特定浏览器中的特定网址?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆