Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Force Internet Explorer to open a website in Edge [closed]

I just visited the apple.com website in the Internet Explorer and noticed, Internet Explorer opens the website directly in Edge and shows this page in the IE-window.

I'd like to implement this to my websites too, so i dont have to opimize all features for the IE. Do you have an idea, how this is possible?

I found this snippet, but it doesnt work: <meta http-equiv="X-UA-Compatible" content="IE=edge">

The answer is very simple can be found here: https://learn.microsoft.com/en-us/microsoft-edge/web-platform/ie-to-microsoft-edge-redirection#request-an-update-to-the-ie-compatibility-list

like image 276
dagrega Avatar asked Sep 30 '20 13:09

dagrega


People also ask

How do I get Internet Explorer to open instead of Edge?

In Edge, click the three dots (ellipsis) in the top right hand corner, then select Settings, then select Default Browser. There is then a heading "Let Internet Explorer open sites in Microsoft Edge".

Why does Microsoft Edge open when I open Internet Explorer?

Microsoft also maintains a list of all the sites that are incompatible with IE. Whenever IE can't render a website, it will automatically redirect you to Microsoft Edge. In other words, IE automatically launches Edge, inviting you to switch to the new web browser.


1 Answers

Run this code at the very start of your website :

if (isIE()) {
  // We open the website in Chrome if it's IE, note that ActiveXObject only works on IE
  var shell = new ActiveXObject("WScript.Shell");
  shell.run("Chrome https://google.com");
}

function isIE() {
  ua = navigator.userAgent;
  // MSIE used to detect old browsers and Trident used to newer ones
  var is_ie = ua.indexOf("MSIE ") > -1 || ua.indexOf("Trident/") > -1;
  return is_ie;
}

It's a hack, but it should work if the user has active X enabled on his browser. If not, he'll get a prompt to enable it.

like image 134
Alexandre Elshobokshy Avatar answered Oct 17 '22 04:10

Alexandre Elshobokshy