diff options
author | Jesús <heckyel@hyperbola.info> | 2020-03-15 13:17:00 -0500 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2020-03-15 13:17:00 -0500 |
commit | 0abc2a48aed57ce2d50b17d3a4a3bc3eace3cf98 (patch) | |
tree | 73f94888c711a8679ecaef2a0320a80368446926 /js/vapi-background.js | |
parent | c6ea3c8b35e3a36be5ff5094997178e0be3b643a (diff) | |
download | ematrix-0abc2a48aed57ce2d50b17d3a4a3bc3eace3cf98.tar.lz ematrix-0abc2a48aed57ce2d50b17d3a4a3bc3eace3cf98.tar.xz ematrix-0abc2a48aed57ce2d50b17d3a4a3bc3eace3cf98.zip |
Cache resolved hostnames
Diffstat (limited to 'js/vapi-background.js')
-rw-r--r-- | js/vapi-background.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/js/vapi-background.js b/js/vapi-background.js index 061ae29..d738504 100644 --- a/js/vapi-background.js +++ b/js/vapi-background.js @@ -34,6 +34,7 @@ Cu.import('chrome://ematrix/content/lib/HttpRequestHeaders.jsm'); Cu.import('chrome://ematrix/content/lib/PendingRequests.jsm'); Cu.import('chrome://ematrix/content/lib/Punycode.jsm'); + Cu.import('chrome://ematrix/content/lib/HostMap.jsm'); // Icon-related stuff vAPI.setIcon = function (tabId, iconId, badge) { @@ -427,6 +428,11 @@ let channelData = this.channelDataFromChannel(channel); if (ηMatrix.userSettings.resolveCname === true) { + if (HostMap.get(URI.host)) { + this.operate(channel, HostMap.get(URI.host), topic); + return; + } + let CC = Components.classes; let CI = Components.interfaces; @@ -446,6 +452,8 @@ let uri = ios.newURI(URI.scheme+'://'+addr, null, null); + HostMap.put(URI.host, addr); + vAPI.httpObserver.operate(channel, uri, topic); }, }; |