Gecko.handlerService.schemes.(protocol).*.uriTemplate

From MozillaZine Knowledge Base
Jump to navigationJump to search

Background

Firefox 3 allows web pages to register themselves as protocol handlers. This allows, for example, all links starting with mailto: to be sent to a webmail provider, or all links starting with webcal: to be sent to an online calendar site. The information on these registrations is kept in mimeTypes.rdf

A set of preferences exists to “seed” the list of registered content handlers. Information from these preferences is copied into mimeTypes.rdf every time the browser sees a new version of content handlers. This preference is an enumerated preference: all preferences whose names start with gecko.handlerService.schemes. are read to generate the list of handlers. (For example: gecko.handlerService.schemes.webcal.0.name and gecko.handlerService.schemes.webcal.0.uriTemplate describe one handler for the webcal: protocol.)

This preference determines the URI template for a content handler for a given protocol. Similar to bookmark keywords, the value can contain the string %s that is replaced with the rest of the link. If the value were http://example.com/?process=%s and the link were to protocol:sample-value, then the browser would be directed to http://example.com/?process=sample-value.

Possible values and their effects

A string used to generate the URI for a web-based protocol handler. If the string %s is present in the value, it is replaced with the rest of the link.

By default, the following preference and value exist:

gecko.handlerService.schemes.webcal.0.uriTemplate
http://handler-test.mozilla.org/webcal?url=%s

First checked in

2007-09-06 by Dan Mosedale

Has an effect in

  • Mozilla Firefox (trunk builds after 2007-09-06)

Related bugs

Related preferences

See also

External links