diff options
author | Jesús <heckyel@hyperbola.info> | 2020-03-15 13:29:16 -0500 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2020-03-15 13:29:16 -0500 |
commit | 01c85372ae8e111c41e5a4cb48af53033d041879 (patch) | |
tree | 8ed23e2dd7f194c3ef85f3498ae45eb30e872277 | |
parent | 23e8cc80ecade58c9ba2722fdefcedb12ae1edf9 (diff) | |
download | ematrix-01c85372ae8e111c41e5a4cb48af53033d041879.tar.lz ematrix-01c85372ae8e111c41e5a4cb48af53033d041879.tar.xz ematrix-01c85372ae8e111c41e5a4cb48af53033d041879.zip |
Update to new HostMap API and log CNAME resolutions
-rw-r--r-- | js/vapi-background.js | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/js/vapi-background.js b/js/vapi-background.js index f9b219b..da32149 100644 --- a/js/vapi-background.js +++ b/js/vapi-background.js @@ -428,14 +428,16 @@ let channelData = this.channelDataFromChannel(channel); if (ηMatrix.userSettings.resolveCname === true) { - if (HostMap.get(URI.host)) { - this.operate(channel, HostMap.get(URI.host), topic); + if (HostMap.get(URI)) { + this.operate(channel, HostMap.get(URI), topic); return; } let CC = Components.classes; let CI = Components.interfaces; + let tab = this.tabIdFromChannel(channel); + let dns = CC['@mozilla.org/network/dns-service;1'] .createInstance(CI.nsIDNSService); @@ -447,12 +449,16 @@ } let addr = rec.canonicalName; + ηMatrix.logger.writeOne(tab, 'info', + 'hostname "' + URI.host + + '" translated to ' + addr); + let ios = CC['@mozilla.org/network/io-service;1'] .createInstance(CI.nsIIOService); let uri = ios.newURI(URI.scheme+'://'+addr, null, null); - HostMap.put(URI.host, addr); + HostMap.put(URI, uri); vAPI.httpObserver.operate(channel, uri, topic); }, |