如何无缝地从Internet Explorer重定向到Microsoft Edge? [英] How to redirect from Internet Explorer to Microsoft Edge seamlessly?

查看:101
本文介绍了如何无缝地从Internet Explorer重定向到Microsoft Edge?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正试图在我的网站上弃用Internet Explorer,并且我想在有人尝试在Internet Explorer上访问Twitter时复制Twitter的行为.

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.

到目前为止,从我对他们的过程的了解来看,似乎有一个基于用户代理字符串的服务器端检查,它可以检测浏览器类型,然后发送一些内容以重定向到 https://twitter.com

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

对我来说,令人困惑的部分是他们如何在不打开询问您是否要打开与应用程序链接的对话框的情况下打开Microsoft Edge.我见过网站使用 microsoft-edge:url 在Microsoft Edge中打开一个url,但这总是询问您是否要打开该应用程序.

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.

如果有帮助,我的网站是基于express.js构建的,而我尝试的重定向基于某些快速中间件中的 res.redirect .

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.

推荐答案

这似乎是Internet Explorer和Edge之间的特殊接口,它使用名为"IEtoEdge BHO"的Internet Explorer浏览器帮助器对象以及一系列不兼容的网站,由Microsoft维护.

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.

这需要Microsoft Edge稳定版87或更高版本.

This requires Microsoft Edge Stable version 87 or later.

https://docs.microsoft.com/zh-cn/部署的ge/edge-learnmore-neededge

以下代码与行为极为相似,但Edge中的对话框除外,用于迁移浏览数据和首选项.我没有收到任何提示,所以可能已经改变了.

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>

这篇关于如何无缝地从Internet Explorer重定向到Microsoft Edge?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆