I have seen this question been asked here Can I force a link to open in a specific browser?
I found one solution which works eg.
window.open("microsoft-edge:https://www.google.com");
This works for Edge
but I am looking for similar solution to open in Internet Explorer.
Tried
ie
, iexplore
, internet-explorer
Also i cant depend on users installing 'open in' extension in their browser.
I could possibly go down the route of editing registry since webapp will be running in corporate systems , but just wanted to check here before going down that route.
Simplest solution would be add a URI scheme for IE, and links in format
ie:http://example.com
will launch IE and visithttp://example.com
.To add a URI scheme for IE, add this registry:
Some important notes:
%1
in double quotes. Otherwise url with multiple params likeexample.com?a=1&b=2
will be stripped toexample.com?a=1
, params after&
will be ignored.iexplore
. If you don't remove the double quotes and open multiple IE window from chrome, only the first IE window will get the correct URL. But removing quotes with commandset url=%%url:\"=%%
orset url=%%url:~1,-1%%
doesn't work.-nosessionmerging
and-noframemerging
toiexplore
. These are command-line options to control "merging" behavior for IE.It looks like IE does not register itself as a URI scheme.
In order for an application (a browser in this case) to listen to a URI-scheme, it needs to be registered in the Registry (for Windows at least). I just ran a small script listing all the registered URI schemes and unlike Edge, I don't see anything that represents Internet Explorer. (I do have it installed).
Of course, the best way would be to avoid Internet Explorer completely since it is deprecated. But if you do stick with it, editing the registry yourself seems the only option.