nsIHttpChannel
is not XMLHttpRequest
. Instead XMLhttpRequest
is a nice wrapper class around channels - not just http ones -, which also adds convenience functions such as getAllResponseHeaders()
.
You may use nsIHttpChannel.visitResponseHeaders
to simulate getAllResponseHeaders
.
if (subject instanceof Ci.nsIHttpChannel) {
var headers = "";
subject.visitResponseHeaders(function(header, value) {
headers += header + ": " + value + "\r\n";
});
}