Skip to content

Commit 7361176

Browse files
committed
Reduce logging, remove unused code
1 parent adb31b3 commit 7361176

File tree

1 file changed

+5
-17
lines changed

1 file changed

+5
-17
lines changed

src/components/https-everywhere.js

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -281,14 +281,13 @@ HTTPSEverywhere.prototype = {
281281
getExpando: function(browser, key) {
282282
let obj = this.expandoMap.get(browser);
283283
if (!obj) {
284-
this.log(WARN, "No expando for " + browser.currentURI);
284+
this.log(NOTE, "No expando for " + browser.currentURI);
285285
return null;
286286
}
287287
return obj[key];
288288
},
289289

290290
setExpando: function(browser, key, value) {
291-
this.log(WARN, "setting expandomap value: "+value);
292291
if (!this.expandoMap.has(browser)) {
293292
this.expandoMap.set(browser, {});
294293
}
@@ -318,13 +317,13 @@ HTTPSEverywhere.prototype = {
318317
loadContext = channel.loadGroup.notificationCallbacks
319318
.getInterface(CI.nsILoadContext);
320319
} catch(e) {
321-
this.log(INFO, "no loadgroup notificationCallbacks for "
320+
this.log(NOTE, "no loadgroup notificationCallbacks for "
322321
+ channel.URI.spec + e);
323322
return null;
324323
}
325324
}
326325
if (!loadContext) {
327-
this.log(WARN, "No loadContext for: " + channel.URI.spec);
326+
this.log(NOTE, "No loadContext for: " + channel.URI.spec);
328327
return null;
329328
}
330329
let browser = loadContext.topFrameElement;
@@ -476,9 +475,6 @@ HTTPSEverywhere.prototype = {
476475
OS.addObserver(this, "http-on-examine-merged-response", false);
477476
OS.addObserver(this, "http-on-examine-response", false);
478477

479-
var dls = CC['@mozilla.org/docloaderservice;1']
480-
.getService(CI.nsIWebProgress);
481-
dls.addProgressListener(this, CI.nsIWebProgress.NOTIFY_ALL);
482478
this.log(INFO,"ChannelReplacement.supported = "+ChannelReplacement.supported);
483479

484480
HTTPSRules.init();
@@ -605,10 +601,10 @@ HTTPSEverywhere.prototype = {
605601
var browser = this.getBrowserForChannel(oldChannel);
606602
var old_alist = null;
607603
if (browser)
608-
old_alist = this.getExpando(browser,"applicable_rules", null);
604+
old_alist = this.getExpando(browser,"applicable_rules");
609605
browser = this.getBrowserForChannel(newChannel);
610606
if (!browser) return null;
611-
var new_alist = this.getExpando(browser,"applicable_rules", null);
607+
var new_alist = this.getExpando(browser,"applicable_rules");
612608
if (old_alist && !new_alist) {
613609
new_alist = old_alist;
614610
this.setExpando(browser,"applicable_rules",new_alist);
@@ -706,10 +702,6 @@ HTTPSEverywhere.prototype = {
706702
catman.deleteCategoryEntry("net-channel-event-sinks",
707703
SERVICE_CTRID, true);
708704

709-
var dls = CC['@mozilla.org/docloaderservice;1']
710-
.getService(CI.nsIWebProgress);
711-
dls.removeProgressListener(this);
712-
713705
this.prefs.setBoolPref("globalEnabled", false);
714706
} catch(e) {
715707
this.log(WARN, "Couldn't remove observers: " + e);
@@ -724,10 +716,6 @@ HTTPSEverywhere.prototype = {
724716
OS.addObserver(this, "http-on-examine-merged-response", false);
725717
OS.addObserver(this, "http-on-examine-response", false);
726718

727-
var dls = CC['@mozilla.org/docloaderservice;1']
728-
.getService(CI.nsIWebProgress);
729-
dls.addProgressListener(this, CI.nsIWebProgress.NOTIFY_LOCATION);
730-
731719
this.log(INFO,
732720
"ChannelReplacement.supported = "+ChannelReplacement.supported);
733721

0 commit comments

Comments
 (0)