简体   繁体   中英

msLaunchUri not working from WebBrowser Control

Setup: Windows 10 with IE 11. WebBrowser control in compatibility mode 11011 (11 Forced).

When used from the WebBrowser control navigator.msLaunchUri is defined but it fails to do anything and does not even call the 'fail' function.

navigator.msLaunchUri works from IE 11 on the same machine (although it sometimes inappropriately calls the fail function).

The exact code I'm using is:

navigator.msLaunchUri('skype:5551212', function() { alert('success'); }, function() { alert('fail'); });

Why would it be defined if it doesn't do anything? Or is there some other configuration that must be defined in the host that I'm missing?

It works fine for me. All I did was add the meta tag to the html doc to indicate the doc mode.

 <meta http-equiv="x-ua-compatible" content="IE=11">

Screenshot 在此输入图像描述

When I don't have the meta tag, it gives me a big fat script error. I suspect you may be suppressing script errors, which would explain why you aren't seeing anything.

Screenshot 2 脚本错误

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM