Firefox3/ContentManagement:Handlers: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
No edit summary
mNo edit summary
Line 1: Line 1:
__NOTOC__
__NOTOC__


= Background =
=Background=
One of the new features of Firefox 3 is the ability to use a web service as a content handler.  A complete functional description for this feature appears at http://wiki.mozilla.org/User:Dmose:Fx-Docs:ContentTypeProcessing.
One of the new features of Firefox 3 is the ability to use a web service as a content handler.  A complete functional description for this feature appears at http://wiki.mozilla.org/User:Dmose:Fx-Docs:ContentTypeProcessing.


Line 9: Line 10:
* '''Invoking''' -- How are these web services actually invoked?
* '''Invoking''' -- How are these web services actually invoked?


== Registration ==
==Registration==
There are two mechanisms by which a web service can become a registered content handler:
There are two mechanisms by which a web service can become a registered content handler:


=== Pre-registered ===
===Pre-registered===
Mozilla will maintain a list of pre-registered web service handlers.  This list will vary by locale, and will be determined by:
Mozilla will maintain a list of pre-registered web service handlers.  This list will vary by locale, and will be determined by:
* (selection criteria TBD)
* (selection criteria TBD)


==== Dynamically Registered Handlers ====
====Dynamically Registered Handlers====
Web sites can also register themselves as content handlers according to the [http://www.whatwg.org/specs/web-apps/current-work/#custom-handlers What-WG Custom Handlers spec] by calling a javascript API.  For example:
Web sites can also register themselves as content handlers according to the [http://www.whatwg.org/specs/web-apps/current-work/#custom-handlers What-WG Custom Handlers spec] by calling a javascript API.  For example:


<code>navigator.registerContentHandler('application/x-soup', 'http://example.com/soup?url=%s', 'SoupWeb™')</code>
<code>navigator.registerContentHandler('application/x-soup', 'http://example.com/soup?url=%s', 'SoupWeb™')</code>


== Defaulting ==
==Defaulting==
One of the pre-registered handlers will also be marked as the preferred handler, meaning that the first time a user encounters a content type, it will be the selected handler if there is no local application already registered for that content type.  The user will still be presented the full list of handlers to choose an alternate, however.
One of the pre-registered handlers will also be marked as the preferred handler, meaning that the first time a user encounters a content type, it will be the selected handler if there is no local application already registered for that content type.  The user will still be presented the full list of handlers to choose an alternate, however.


* (selection criteria TBD)
* (selection criteria TBD)


== Invoking ==
==Invoking==
Registered web services will be invoked according to the [http://www.whatwg.org/specs/web-apps/current-work/#custom-handlers What-WG Custom Handlers spec] and the URL pattern that was registered.  For example:
Registered web services will be invoked according to the [http://www.whatwg.org/specs/web-apps/current-work/#custom-handlers What-WG Custom Handlers spec] and the URL pattern that was registered.  For example:


Line 32: Line 33:




= Information needed for Pre-Registered Content Handler file =  
=Information needed for Pre-Registered Content Handler file=  


== Protocols ==
==Protocols==


=== "Complete" List ===
==="Complete" List===
* [http://www.iana.org/assignments/uri-schemes.html IANA Official list?]
* [http://www.iana.org/assignments/uri-schemes.html IANA Official list?]
* [http://en.wikipedia.org/wiki/URI_scheme Wikipedia list of common URI Schemes]
* [http://en.wikipedia.org/wiki/URI_scheme Wikipedia list of common URI Schemes]


=== For Inclusion ===
===For Inclusion===
{| class="fullwidth-table"
{| class="fullwidth-table"
!Protocol !! Candidate Web Services !! Comments
!Protocol !! Candidate Web Services !! Comments
Line 58: Line 59:
|}
|}


== MIME Types & Filename Extensions ==
==MIME Types & Filename Extensions==


=== "Complete" List ===
==="Complete" List===
* See https://addons.mozilla.org/en-US/firefox/addon/4498
* See https://addons.mozilla.org/en-US/firefox/addon/4498


=== For Inclusion ===
===For Inclusion===
{| class="fullwidth-table"
{| class="fullwidth-table"
!Mime Type !! Extensions !! Candidate Web Services !! Comments
!Mime Type !! Extensions !! Candidate Web Services !! Comments
Line 82: Line 83:




= Questions =
=Questions=
* Is the list of pre-registered web service handlers part of the build or dynamically updated by checking an online master regularly?
* Is the list of pre-registered web service handlers part of the build or dynamically updated by checking an online master regularly?
* Is there a need / use case for a web service to be the preferred handler, even if there ''is'' a registered local application?
* Is there a need / use case for a web service to be the preferred handler, even if there ''is'' a registered local application?

Revision as of 21:54, 18 June 2007


Background

One of the new features of Firefox 3 is the ability to use a web service as a content handler. A complete functional description for this feature appears at http://wiki.mozilla.org/User:Dmose:Fx-Docs:ContentTypeProcessing.

To enable this feature, however, we need to create new mechanisms to augment the ones the operating systems provide for local applications:

  • Registering -- How does Firefox know what web services can handle each content type?
  • Defaulting -- When and which web services do we pick as defaults?
  • Invoking -- How are these web services actually invoked?

Registration

There are two mechanisms by which a web service can become a registered content handler:

Pre-registered

Mozilla will maintain a list of pre-registered web service handlers. This list will vary by locale, and will be determined by:

  • (selection criteria TBD)

Dynamically Registered Handlers

Web sites can also register themselves as content handlers according to the What-WG Custom Handlers spec by calling a javascript API. For example:

navigator.registerContentHandler('application/x-soup', 'http://example.com/soup?url=%s', 'SoupWeb™')

Defaulting

One of the pre-registered handlers will also be marked as the preferred handler, meaning that the first time a user encounters a content type, it will be the selected handler if there is no local application already registered for that content type. The user will still be presented the full list of handlers to choose an alternate, however.

  • (selection criteria TBD)

Invoking

Registered web services will be invoked according to the What-WG Custom Handlers spec and the URL pattern that was registered. For example:

http://example.com/soup?url=http%3A%2F%2Fwww.example.net%2Fchickenk%C3%AFwi.soup


Information needed for Pre-Registered Content Handler file

Protocols

"Complete" List

For Inclusion

Protocol Candidate Web Services Comments
Common
mailto Yahoo Mail, GMail, Hotmail
webcal Google Calendar
news/snews Google News
irc/ircs
feed Google, My Yahoo!, Bloglines

MIME Types & Filename Extensions

"Complete" List

For Inclusion

Mime Type Extensions Candidate Web Services Comments
application/rss+xml
application/atom+xml
Google, My Yahoo, bloglines separate audio-, video-, and image-oriented feeds by sniffing?
doc
ppt
xls
ics
vcard


Questions

  • Is the list of pre-registered web service handlers part of the build or dynamically updated by checking an online master regularly?
  • Is there a need / use case for a web service to be the preferred handler, even if there is a registered local application?
  • Need to discuss with web service providers how to deal with protected URLs (behind a log-in or firewall).
    • Downloading and then uploading seems like a bad option
      • Very slow / bad user-experience for large files
      • "Leakage" a huge security concern
    • Ideally, it would be the web service provider's responsibility to figure out delegation model.