PageDataChild: Return null channelInfo on non-HTTP channel
Rather than throwing. Fixes requireSuccessfulStatus on file: (etc.) URIs.
This commit is contained in:
parent
9b7d3edbb3
commit
5f8ea3af9c
1 changed files with 11 additions and 10 deletions
|
@ -31,17 +31,18 @@ class PageDataChild extends JSWindowActorChild {
|
||||||
|
|
||||||
case "channelInfo": {
|
case "channelInfo": {
|
||||||
let docShell = this.contentWindow.docShell;
|
let docShell = this.contentWindow.docShell;
|
||||||
let channel = (docShell.currentDocumentChannel || docShell.failedChannel)
|
try {
|
||||||
?.QueryInterface(Ci.nsIHttpChannel);
|
let channel = (docShell.currentDocumentChannel || docShell.failedChannel)
|
||||||
if (channel) {
|
?.QueryInterface(Ci.nsIHttpChannel);
|
||||||
return {
|
if (channel) {
|
||||||
responseStatus: channel.responseStatus,
|
return {
|
||||||
responseStatusText: channel.responseStatusText
|
responseStatus: channel.responseStatus,
|
||||||
};
|
responseStatusText: channel.responseStatusText
|
||||||
}
|
};
|
||||||
else {
|
}
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
catch (e) {}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue