Visit Mozilla.org

DOM:window.navigator.registerContentHandler

From MDC

« Gecko DOM Reference

Contents

[edit] Summary

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.

[edit] Syntax

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.

[edit] Example

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

[edit] Notes

For Firefox 2, 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.

[edit] Specification

Specified by the WHATWG's Web Applications 1.0 working draft.