“navigator.msLaunchUri” in IE Edge always return success

馋奶兔 提交于 2020-01-01 19:24:28

问题


"navigator.msLaunchUri" in IE Edge always return success , "noHandlerCallback" is not executed I tried this :

navigator.msLaunchUri('App:123456',
function()
{
alert('success');
},
function()
 {
alert('failed');
}
);

It will always return "success" and if the protocol was not supported it will open the windows store dialog and return "success"


回答1:


I have seen that Edge behaves differently from IE11 in this regard. I am not sure if this exactly the same problem that you are experiencing but this is what I have seen.

If you register a protocol, launch it with IE11 and later unregister, Edge gets confused.

Short Answer:

Make sure that when you unregister your protocol, you completely remove the following registry keys if they exist:

HKEY_CURRENT_USER\Software\Classes\myprotocol
HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\ProtocolExecute\myprotocol

Long Answer:

When you call msLaunchUri, IE11 looks at the first key above to determine if the protocol is registered, but Edge looks at both keys.

The first one is the key that you use to register the protocol, the second one is a key created by IE11 when you launch the protocol from it.

So if the user happens to launch the protocol with IE11, then unregister, Edge will get confused.

To make sure Edge does not get confused, remove all the keys completely.



来源:https://stackoverflow.com/questions/36473198/navigator-mslaunchuri-in-ie-edge-always-return-success

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!