Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Navigator.registerContentHandler()

概述

Allows web sites to register themselves as possible handlers for content of a particular MIME type.

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

语法

window.navigator.registerContentHandler(mimeType, uri, title);
  • mimeType is the desired MIME type as a string.
  • uri is the URI to the handler as a string.
  • title is the title of the handler presented to the user as a string.

例子

navigator.registerContentHandler("application/vnd.mozilla.maybe.feed",
                                 "https://www.example.tld/?foo=%s",
                                 "My Feed Reader");

备注

For Firefox 2 and above, only the application/vnd.mozilla.maybe.feed, application/atom+xml, and application/rss+xml MIME types are supported. All values have the same effect, and the registered handler will receive feeds in all Atom and RSS versions  (see bug 391286).

规范

WHATWG's Web Applications 1.0 工作草案

相关链接

文档标签和贡献者

 此页面的贡献者: teoli, khalid32, ziyunfei
 最后编辑者: teoli,