Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I redirect IE11 to Edge like Stack Overflow

When you navigate to https://stackoverflow.com in IE11, it redirects the user to Edge with the following tab open: https://support.microsoft.com/en-us/office/the-website-you-were-trying-to-reach-doesn-t-work-with-internet-explorer-8f5fc675-cd47-414c-9535-12821ddfc554?ui=en-us&rs=en-us&ad=us

How do I implement this in my own site? Is there a meta tag that can enable this?

EDIT: Here's a clip of what it looks like. Tried on Windows 10. https://streamable.com/nwtt22

like image 863
Danman Avatar asked Sep 03 '20 20:09

Danman


2 Answers

I was wondering this too. After reading Joshua Joppie's answer, I did some Googling and found this webpage.

Turns out, you need to e-mail Microsoft to get your site added to the Edge-only list (how to do so is explained on that page). I'm not sure if they'll take a request from anyone, or whether you need to be a big website, like Stack Overflow. It's worth trying anyway, as the only requirement they give is this:

The IE compatibility list is designed to work with public sites only.

To be honest, I've no idea why they didn't just make a <meta> tag for it. It would be much easier.

If I have time (which I doubt), I plan to make a JS programme that mimics the functionality of a website's presence on this list and I will link to it here. You could always do a user agent check that redirects the user to microsoft-edge:https://example.com (where example.com is your website) if it detects them using Internet Explorer.

like image 63
Llamax Avatar answered Sep 20 '22 05:09

Llamax


Need to add the below script in the head tag to redirect your website in Edge browser

<script>
   if(/MSIE \d|Trident.*rv:/.test(navigator.userAgent)) {
      window.location = 'microsoft-edge:' + window.location;
      setTimeout(function() {
         window.open('', '_self', '').close();
         // window.location = 'https://support.microsoft.com/en-us/topic/we-recommend-viewing-this-website-in-microsoft-edge-160fa918-d581-4932-9e4e-1075c4713595?ui=en-us&rs=en-us&ad=us';            
      }, 0);
   }
</script>
like image 36
Kanaksinh Rahevar Avatar answered Sep 21 '22 05:09

Kanaksinh Rahevar