作者: nick 分类: js 发布时间: 2012-03-25 07:50 ė 6没有评论


Allows web sites to register themselves as possible handlers for particular protocols.

Note: Web sites may only register protocol handlers for themselves. For security reasons, it’s not possible for an extension or web site to register protocol handlers targeting other sites.


window.navigator.registerProtocolHandler(protocol, uri, title);
  • protocol is the protocol the site wishes to handle, specified as a string.
  • uri is the URI to the handler as a string. You can include “%s” to indicate where to insert the escaped URI of the document to be handled.
  • title is the title of the handler presented to the user as a string.


If your web application is located at, you can register a protocol handler for it to handle “mailto” like this:

                                  "Example Mail");

This creates a handler that allows mailto links to direct the user to your web application, inserting the email address specified in the link into the URL.


Specified by the WHATWG’s Web Applications 1.0 working draft (HTML5).

Browser compatibility

  • Desktop
  • Mobile
Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support 13

Protocol whitelist includes mailto, mms, nntp, rtsp, and webcal. Custom protocols must be prefixed with “web+”.

3.0 (1.9) ? Opera 11.60 ?

本文出自 传播、沟通、分享,转载时请注明出处及相应链接。



电子邮件地址不会被公开。 必填项已用*标注

您可以使用这些HTML标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>