非标
此特征是非标准的,且不在标准轨道中。不要在面向 Web 的生产站点中使用它:它不适用于每个用户。实现之间可能存在大的不兼容性,且行为将来可能改变。

msLaunchUri() method is a Microsoft extension to the Navigator interface, which starts a service or app, such as an email client, that handles a given protocol. The Uniform Resource Identifier (URI) contains the protocol for the default service or app, such as mailto://test@contoso.com .

This proprietary method is specific to Internet Explorer, and Microsoft Edge versions 18 and lower.

句法

navigator.msLaunchUri(uri, successCallback, noHandlerCallback);
					

参数

uri
A DOMString specifying the URL containing including the protocol of the document or resource to be displayed.
successCallback 可选
A function matching the signature of MSLaunchUriCallback to be executed if the protocol handler is present.
noHandlerCallback 可选
A function matching MSLaunchUriCallback to be executed if the protocol handler is not present.

返回值

undefined .

用法注意事项

If a default protocol handler is available on the system that matches the URI, the successCallback is invoked, otherwise, the noHandlerCallback 被调用。

To help protect a user's privacy, Windows displays a prompt for the user to allow the service or app to be launched. The user can choose to not see the prompt after the first instance for a particular protocol and automatically open the app or service without a user intervention. The msLaunchUri() method does not support HTTP, Secure Hypertext Transfer Protocol (HTTPS), File Transfer Protocol (FTP), file, res, JavaScript, or Microsoft Visual Basic Scripting Edition (VBScript) protocols.

If the user's system does not have a program registered to handle a specific protocol, and a noHandlerCallback is provided, Windows Internet Explorer will invoke the noHandlerCallback . This enables developers to provide a custom fallback experience for the user. If a handler doesn't exist, and the developer doesn't provide a noHandlerCallback , then Internet Explorer displays a dialog that asks the user if they want to allow the action. If the user allows it, the user is then prompted to look in the Windows Store for an app to handle the protocol. If multiple programs are registered on the system for the given protocol and no default has been chosen, Windows prompts the user to choose one.

另请参阅

元数据

  • 最后修改: