Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<blockquote> <p>I don't want to bother learning the old methods if they are slated to be removed</p> </blockquote> <p>There are no plans now, or in the future, to remove legacy add-on support. At least that's what add-on SDK folks and extension manager folks told me repeatedly.</p> <p>Back to your question: The add-on sdk does not provide an explicit API for stuff like this, but you can always go even more low-level, even in the SDK (via the <a href="https://addons.mozilla.org/en-US/developers/docs/sdk/latest/dev-guide/tutorials/chrome.html" rel="nofollow"><code>chrome</code></a> module and/or <a href="https://addons.mozilla.org/en-US/developers/docs/sdk/latest/modules/sdk/window/utils.html" rel="nofollow"><code>window/utils</code></a>).</p> <p>To implement additional compression methods, you'd need to implement the <a href="http://mxr.mozilla.org/mozilla-central/source/netwerk/streamconv/public/nsIStreamConverter.idl" rel="nofollow"><code>nsIStreamConverter</code></a> interface and properly register your component under the <code>@mozilla.org/streamconv;1@?from=&lt;yourcompression&gt;&amp;to=uncompressed</code> contract. Then Firefox should be able to decode <code>yourcompression</code>.</p> <ul> <li>See <a href="https://developer.mozilla.org/" rel="nofollow">https://developer.mozilla.org/</a> for more information on how to implement and register XPCOM components in either javascript or C++.</li> <li>Using the SDK or implementing your add-on restartless will require you register the component yourself instead of relying on chrome.manifest. There are a couple of add-on doing so already, e.g. <a href="https://hg.adblockplus.org/adblockplus/file/0d76ad7eb80b/lib/contentPolicy.js#l365" rel="nofollow">Adblock Plus</a>.</li> <li>Binary (C++) components should be avoided because you'll obviously need to compile your component for each supported platform and you'll need to re-compile it for each Gecko version. If you have to go binary, a javascript component stub + <a href="https://developer.mozilla.org/en-US/docs/Mozilla/js-ctypes" rel="nofollow">js-ctypes</a> might be better.</li> <li>See the mozilla source code on how to <a href="http://mxr.mozilla.org/mozilla-central/ident?i=nsIStreamConverter" rel="nofollow">implement <code>nsIStreamConverter</code></a> in the first place.</li> </ul> <p>You may also need to modify the <code>network.http.accept-encoding</code> preference so that the compression may be actually negotiated with the server.</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