Opening window in Edge from the page in IE on Windows 10

问题: I have a web page in IE and a button that opens another page in the new window. The group policy specifies that the URL for the new page should be opened in Edge but when I...

问题:

I have a web page in IE and a button that opens another page in the new window. The group policy specifies that the URL for the new page should be opened in Edge but when I click on the button it still opens the window in IE. If however I try to open that page from the link in Word document then it does open in Edge.

According to a tester in my firm this used to work. Apparently he was able to use the button in IE and open the page in Edge.

My knowledge of Javascript suggests that this should not be possible. Anybody disagrees?

Thanks,

Goran

-I tried opening the new URL from Word and it opened in Edge

-I tried opening the new URL from a simple HTML page that only has a button and it opens it in IE.

Here is the code for the simple HTML page:

<html>
    <body>
        <input type="button" value="Open" ONCLICK="window.open('[URL comes here]', '_blank', 'height=600,width=800');">
    </body>
</html>

Expectations were that the page should open in Edge, but it opens in IE which I suspect is right.


回答1:

Edge registers the protocol "microsoft-edge". So you can open a webpage in Edge by specifiying this protocol before the actual url.

Using a static link:

<a href="microsoft-edge:http://www.google.com">Test</a>

Or from javascript

function test()
{
  location.href = 'microsoft-edge:http://www.google.com';
}

Obviously, you cannot specify a window name or dimensions of a popup window this way.

  • 发表于 2019-07-04 18:32
  • 阅读 ( 141 )
  • 分类:sof

条评论

请先 登录 后评论
不写代码的码农
小编

篇文章

作家榜 »

  1. 小编 文章
返回顶部
部分文章转自于网络,若有侵权请联系我们删除