import from custom branch of UXP:

- devtools: don't report error if remoteAddress/remotePort returns NS_ERROR_NOT_AVAILABLE (3ec8369f)
- devtools: don't report error if impl is null (aa8671dc)
This commit is contained in:
2023-11-30 13:43:31 +08:00
parent 09de2d7e37
commit ed36cdeb3e
@@ -320,7 +320,7 @@ NetworkResponseListener.prototype = {
let impl = this._wrappedNotificationCallbacks.getInterface(iid);
impl[method].apply(impl, args);
} catch (e) {
if (e.result != Cr.NS_ERROR_NO_INTERFACE) {
if (e.name != "TypeError" && e.result != Cr.NS_ERROR_NO_INTERFACE) {
throw e;
}
}
@@ -1354,13 +1354,13 @@ NetworkMonitor.prototype = {
try {
response.remoteAddress = httpActivity.channel.remoteAddress;
} catch (e) {
Cu.reportError(e);
if (e.result != Cr.NS_ERROR_NOT_AVAILABLE) Cu.reportError(e);
}
response.remotePort = null;
try {
response.remotePort = httpActivity.channel.remotePort;
} catch (e) {
Cu.reportError(e);
if (e.result != Cr.NS_ERROR_NOT_AVAILABLE) Cu.reportError(e);
}
response.status = statusLineArray.shift();
response.statusText = statusLineArray.join(" ");