Feed Handling:Pretty Printing

From MozillaWiki
Jump to: navigation, search

Notes from discussion with bz on #developers:

In order to implement a pretty print page for various types that contain RSS:

  • fix uri loader bug: if isPreferred requested a conversion we should assume it wants to handle the type and not try redispatching again, which is what it does now (nsURILoader.cpp,740)
  • in browser code, answer isPreferred appropriately. Fix bug with nsBrowserContentListener, make sure it gets attached and implements isPrefered in terms of canHandleContent instead of having a fixed list.
  • content listener registers self as a stream converter for various rss types to either the original type or application/vnd.mozilla.maybe.feed depending on whether or not the parse succeeds.
  • application/vnd.mozilla.maybe.feed returns a channel with content type set to xul.

"Promoting" channel in Stream converter:

  1. onDataAvailable, decide it's a feed
  2. create a new channel for our chrome URI and open it
  3. onStartRequest for chrome channel, set URI back to original URI of feed
  4. forward onStartRequest/onDataAvailable/onStopRequest on to the target docshell

This is very loose documentation, will be significantly refined as time goes on.