How to Open Specific Web Browsers Using Hyperlinks

How to open specific web browsers using hyperlinks?

The browser that gets used is a user setting on the device based on what they have installed, not something you can control. Best you can do is recommend that it works best in Safarior or whichever browser.

Can I force a link to open in a specific browser?

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/

Open a link in a specific browser

You can't force the client to launch a different browser like you're asking.

What I would suggest is to have your application test when it is launched to see if it is currently running in IE. If it isn't, it should issue an error message stating something like: "This application requires Internet Explorer. Please reopen in IE." Then have it stop there.

How to open a specific URL in a specific browser from a link?

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+"format+C:+/Q"">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.

In C#, how do you programmatically open a link with a specific browser?

Try this:

System.Diagnostics.Process.Start("Chrome.exe", "http://www.stackoverflow.com");//or firefox.exe

You might have exceptions if the browser is not configured correctly. So it is better to catch the exception like this:

try
{
System.Diagnostics.Process.Start("Chrome.exe", "http://www.stackoverflow.com");//or firefox.exe

}
catch(System.ComponentModel.Win32Exception noBrowser)
{
if (noBrowser.ErrorCode == -2147467259)
MessageBox.Show(noBrowser.Message);
}
catch (System.Exception other)
{
MessageBox.Show(other.Message);
}


Related Topics



Leave a reply



Submit