Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You can register a component that implements the <code>nsIRUIContentListener</code> interface with the category manager. The category is <code>external-uricontentlisteners</code>. The entry is the MIME type that you want to register. The value is your component's contract ID.</p> <p>Alternatively it is possible to register a component directly with the URI listener but this is only useful if your are already loading your component at startup.</p> <p>When your user clicks on a link to a document served with that MIME type (and there are no installed plugins already handling that type) then your component will be created. One of the <code>isPreferred</code> or <code>canHandleContent</code> methods will be called; you should verify that the content type is the one you want and then return true. Your <code>doContent</code> method will then be called and you can use this to open a window to handle the request. You should return true to indicate that you are not actually providing content for the existing window.</p> <p>EDIT:</p> <p>If you want to read the document and output another document in-place, you need to register a stream converter instead. This is done by registering a component that implements the <code>nsIStreamConverter</code> interface hierarchy with the contract ID <code>@mozilla.org/streamconv;1?from=&lt;MIME&gt;&amp;to=&lt;MIME&gt;</code>. I'm not 100% sure but you may have to set the <code>to</code> to be <code>*/*</code> and then your <code>GetContentType</code> method should return the actual content type you provide. Your <code>asyncConvertData</code> method will then be passed the destination stream listener. Data will be made available to you via the base <code>nsIStreamListener</code> interface and you can then make the converted data available to the destination stream.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload