admin管理员组文章数量:1333442
Windows 10 ships with both modern Microsoft Edge browser, and the legacy Internet Explorer 11.
Based on analytics, I suspect some of my Windows 10 users use IE11 and are perhaps not aware of having Edge browser.
Is it possible to create a link in HTML which opens the website in Edge, if the user is on IE11 on Win10?
Windows 10 ships with both modern Microsoft Edge browser, and the legacy Internet Explorer 11.
Based on analytics, I suspect some of my Windows 10 users use IE11 and are perhaps not aware of having Edge browser.
Is it possible to create a link in HTML which opens the website in Edge, if the user is on IE11 on Win10?
Share edited Jan 15, 2020 at 14:36 TylerH 21.1k78 gold badges79 silver badges112 bronze badges asked Dec 13, 2018 at 16:16 jakub.gjakub.g 41.5k12 gold badges101 silver badges139 bronze badges1 Answer
Reset to default 9It's possible to open a URL in Edge Spartan thanks to microsoft-edge:
protocol. This works in any browser on Windows 10. For example:
<a href="microsoft-edge:https://www.cnn.">CNN</a>
Note however that this does not (yet?) work with Edge Chromium.
Checking if browser is IE11 on Windows 10 can be done for example as follows:
if (document.documentMode === 11 && navigator.userAgent.indexOf('Windows NT 10.0') > -1) {
...
}
If you want to create an Edge link to the current page (without hardcoding), you can do it with JavaScript:
myAnchor.href = 'microsoft-edge:' + document.URL;
Demo: https://jg-testpage.github.io/ie11/open-in-edge.html?foo=bar&baz=quux
本文标签:
版权声明:本文标题:Is it possible to open Microsoft Edge from a page rendered in Internet Explorer via just HTMLJavaScript? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742293068a2448176.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论