From f7e146b34388db880d34d4d8082d71f903c6cabe Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Wed, 28 Feb 2018 08:51:01 +0100 Subject: [partial fix] DevTools - network - proxy - throws an errors (remoteAddress) https://github.com/MoonchildProductions/moebius/pull/63 --- devtools/shared/webconsole/network-monitor.js | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'devtools/shared') diff --git a/devtools/shared/webconsole/network-monitor.js b/devtools/shared/webconsole/network-monitor.js index 084493432..5416a7760 100644 --- a/devtools/shared/webconsole/network-monitor.js +++ b/devtools/shared/webconsole/network-monitor.js @@ -1327,8 +1327,24 @@ NetworkMonitor.prototype = { let response = {}; response.httpVersion = statusLineArray.shift(); - response.remoteAddress = httpActivity.channel.remoteAddress; - response.remotePort = httpActivity.channel.remotePort; + // XXX: + // Sometimes, when using a proxy server (manual proxy configuration), + // throws an errors: + // 0x80040111 (NS_ERROR_NOT_AVAILABLE) + // [nsIHttpChannelInternal.remoteAddress] + // Bug 1337791 is the suspect. + response.remoteAddress = null; + try { + response.remoteAddress = httpActivity.channel.remoteAddress; + } catch (e) { + Cu.reportError(e); + } + response.remotePort = null; + try { + response.remotePort = httpActivity.channel.remotePort; + } catch (e) { + Cu.reportError(e); + } response.status = statusLineArray.shift(); response.statusText = statusLineArray.join(" "); response.headersSize = extraStringData.length; -- cgit v1.2.3