I'm trying to deprecate Internet Explorer on my website, and I would like to replicate Twitter's behavior when someone tries to visit the site on Internet Explorer.
From what I've pieced together of their process so far it seems like there is a server side check based on the User Agent string that detects the browser type, then sends something to redirect to https://go.microsoft.com/fwlink/?linkid=2135547 but simultaneously opens up Microsoft Edge and directs that to https://twitter.com
The confusing part for me is how they manage to open Microsoft Edge without opening a dialog box that asks whether you would like to open the link with the application. I've seen websites use microsoft-edge:url
to open an url in Microsoft Edge but that always asks you whether you'd like to open that application or not.
If anyone has information on how they manage it or how to replicate it, it'd be appreciated.
In case it helps, my website is built on express.js, and the redirecting I'm trying is based on res.redirect
in some express middleware.
in the internet Explorer compatibility setting, you will see an option "Let Internet Explorer open sites in Microsoft Edge" , the default value is Incompatible Sites only(Recommended). You can change it to Never.
This appears to be a special interface between Internet Explorer and Edge that uses an Internet Explorer Browser Helper Object named “IEtoEdge BHO” along with a list of incompatible websites that is maintained by Microsoft.
This requires Microsoft Edge Stable version 87 or later.
https://docs.microsoft.com/en-us/deployedge/edge-learnmore-neededge
The following code closely resembles the behavior, with the exception of the dialog in Edge to migrate the browsing data and preferences. I don't receive any prompt, so perhaps that has changed.
<script>
if(/MSIE \d|Trident.*rv:/.test(navigator.userAgent)) {
window.location = 'microsoft-edge:' + window.location;
setTimeout(function() {
window.location = 'https://go.microsoft.com/fwlink/?linkid=2135547';
}, 1);
}
</script>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With