在边缘IE模式中,当一个新窗口被迫出现在MS Edge (无ie模式)而没有边缘调用窗口时。
在A(边缘IE模式)上运行边缘,B称为无边缘IE模式。但是,窗口A不会自动关闭。

<html>
<head>
<script type="text/javascript">
function test()
{
location.href = 'microsoft-edge:https://www.google.com';
}
function popup(){
let options = "toolbar=no,scrollbars=no,resizable=yes,status=no,menubar=no";
window.open("microsoft-edge:"+"https://www.google.com", options);
}
</script>
</head>
<body>
<br>
<a href="microsoft-edge:https://www.google.com" rel="noopener noreferrer">href direct</a><br>
<br>
<a href="#" onclick="test();">location</a><br>
<br>
<a href="#" onclick="popup();">window open</a><br>
<br>
<a href="microsoft-edge:http://www.google.com" onclick="window.open(this.href,'_blank');return false;">onclick</a>
</body>
</html>发布于 2022-07-26 08:21:31
使用microsoft-edge协议切换到边缘浏览器不会关闭原始窗口,因为协议用于打开应用程序。这与打开一个可以在代码中添加_blank或_self的页面不同。
当然,您可以在window.close()之后添加location.href或window.open()来关闭原始窗口。但它只在IE模式下工作。在Chrome等其他浏览器中,原来的窗口仍然存在。
https://stackoverflow.com/questions/73103465
复制相似问题