Home > Net >  How to show new window when href from Edge IE Mode to Edge
How to show new window when href from Edge IE Mode to Edge

Time:07-25

In Edge IE Mode, when a new window is forced to appear on MS Edge, it is added to a new tab rather than a pop-up.

How to show new window when href from Edge IE Mode to Edge??

---add-- If i have to force Edge to run in IE Mode, I want to pop up in a new window rather than a new tab.

https://i.stack.imgur.com/mOW95.png

<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>

CodePudding user response:

First, if you don't configure the site in the IE mode list, it will open the site in Microsoft Edge instead of Edge IE mode by default.

Second, if you need to open a new window, you can add height and width to the windowFeatures parameter in window.open(), like this:

function popup() {
    let options = "toolbar=no,scrollbars=no,resizable=yes,status=no,menubar=no,height=450,width=720";
    window.open("https://www.google.com","Popup", options);
 }
  • Related