Non-standard
This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.
Summary
Allows web sites to register themselves as possible handlers for content of a particular MIME type.
Syntax
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.
Example
navigator.registerContentHandler( "application/vnd.mozilla.maybe.feed", "http://www.example.tld/?foo=%s", "My Feed Reader" );
Notes
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).
Firefox is the only browser that implemented this feature, it wasn't implemented to the standard. This feature has since been removed from the HTML standard and shouldn't be used.
Browser compatibility
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | ? | 2.0 (1.8.1) | ? | ? | ? |
Feature | Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|
Basic support | ? | ? | ? | ? | ? |
See also
- Web-based protocol handlers
- Navigator.registerProtocolHandler()
- Web activities, particularly view and open
- XPCOM Interface Reference > nsIWebContentHandlerRegistrar > registerContentHandler - This shows how to use this function XPCOM scope