The implementation of XMLHttpRequest.overrideMimeType() is here: https://searchfox.org/mozilla-central/rev/d1e33e3e11f559952d7d80e722d26a6cf5dd80ac/dom/xhr/XMLHttpRequestMainThread.cpp#3086-3090
You probably want to do something like this: https://searchfox.org/mozilla-central/rev/d1e33e3e11f559952d7d80e722d26a6cf5dd80ac/dom/xhr/XMLHttpRequestMainThread.cpp#1826-1828 Cheers! On Sat, 14 Sep 2019 at 09:45, john.bieling--- via dev-platform < dev-platform@lists.mozilla.org> wrote: > I am working on a wrapper for nsIHttpChannel with the interface of > MLHttpRequest. Mainly to be able to use the codeBbasePrincipal (or > ContextPrincipal as it is called now I think) with XHR requests, but > without authors having to rewrite their code. > > This is for Thunderbird Add-Ons, which still can access nsIHttpChannel. > > I am pretty far and it is working nicely. > > However, I was not able to find a place in the nsIHttpChannel > specification, which I could map to > > XMLHttpRequest.overrideMimeType() > > Is there any option/requirement to manually overide the MimeType of > responses received via a nsIStreamListener or a nsIStreamLoaderObserver. > > The wrapper is here, if you want to have a look: > > https://gitlab.com/jobisoft/CardBook/blob/Thunderbird67+/chrome/content/cardbookHttpRequest.js > > Thanks for any help, > John > _______________________________________________ > dev-platform mailing list > dev-platform@lists.mozilla.org > https://lists.mozilla.org/listinfo/dev-platform > _______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform