I have a situation where-in I have to open some urls in internet explorer. By default, the user can be browsing a page on chrome or edge or firefox. However, if certain links on the page are opened, it should open it in internet explorer since those pages depend upon the functionality of some IE related features. How do we fo this in javascript?
Asked
Active
Viewed 149 times
0
-
Been asked plenty of times and the simple answer is no. – epascarello Nov 13 '19 at 17:13
-
I agree with the suggestion given by Brad, for more example you can refer this thread link. https://stackoverflow.com/questions/28744149/launch-ie-from-a-link-in-chrome – Deepak-MSFT Nov 14 '19 at 02:36
1 Answers
1
Normally you don't get to choose what browser is opened. The only thing you can do is register a protocol handler on the computer, and use that protocol.
https://learn.microsoft.com/en-us/windows/win32/search/-search-3x-wds-ph-install-registration
For example, you might register something like:
internet-explorer://https://example.com
And then rather than using window.open()
(which probably won't work), just link to this URL.

Brad
- 159,648
- 54
- 349
- 530
-
I wonder how many people are going to blindly copy the code here over time and say "it does not work" :) – epascarello Nov 13 '19 at 17:14
-
-
Thanks @Brad... this would involve registering the handler on all enduser machines... just wondering - do we have anything that can be set at the webserver that tells the client to open the url in IE? – pranag Nov 14 '19 at 03:02
-
@pranag Correct, you would need your users to install your handler, possibly through a simple script or something. No, there's absolutely nothing you can do from the web server end, or on-page, to trigger the site to open in Internet Explorer. It's the user's choice what browser to use. Maybe if you require IE for some things, you should prompt the user to switch, since you can detect what browser they're using. – Brad Nov 14 '19 at 03:57
-
1got it working by following the steps given in https://learn.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/platform-apis/aa767914(v=vs.85)?redirectedfrom=MSDN which gives a step by step implementation for protocol handlers – pranag Nov 18 '19 at 10:04