aboutsummaryrefslogtreecommitdiffstats
path: root/js/vapi-background.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/vapi-background.js')
-rw-r--r--js/vapi-background.js8
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);
},
};