summaryrefslogtreecommitdiff
path: root/data/extensions/https-everywhere-eff@eff.org/components/https-everywhere.js
diff options
context:
space:
mode:
authorRuben Rodriguez <ruben@gnu.org>2016-05-10 19:16:58 -0400
committerRuben Rodriguez <ruben@gnu.org>2016-05-10 19:16:58 -0400
commit789ffd1155c1cc9f4fa7f719346d68cfabada800 (patch)
tree09365dd814afec3aa2df506e286b1060eef70491 /data/extensions/https-everywhere-eff@eff.org/components/https-everywhere.js
parent6ec779969597671308c74e812d48604ddde81495 (diff)
HTTPS-Everywhere updated to 5.1.6
Diffstat (limited to 'data/extensions/https-everywhere-eff@eff.org/components/https-everywhere.js')
-rw-r--r--data/extensions/https-everywhere-eff@eff.org/components/https-everywhere.js23
1 files changed, 21 insertions, 2 deletions
diff --git a/data/extensions/https-everywhere-eff@eff.org/components/https-everywhere.js b/data/extensions/https-everywhere-eff@eff.org/components/https-everywhere.js
index 84f2cd8..c360dad 100644
--- a/data/extensions/https-everywhere-eff@eff.org/components/https-everywhere.js
+++ b/data/extensions/https-everywhere-eff@eff.org/components/https-everywhere.js
@@ -246,7 +246,8 @@ HTTPSEverywhere.prototype = {
QueryInterface: XPCOMUtils.generateQI(
[ Components.interfaces.nsIObserver,
Components.interfaces.nsISupports,
- Components.interfaces.nsISupportsWeakReference ]),
+ Components.interfaces.nsISupportsWeakReference,
+ Components.interfaces.nsIChannelEventSink ]),
wrappedJSObject: null, // Initialized by constructor
@@ -568,7 +569,7 @@ HTTPSEverywhere.prototype = {
break;
}
} else if (topic == "browser:purge-session-history") {
- // The list of rulesets that have been loaded from the sqlite DB
+ // The list of rulesets that have been loaded from the JSON DB
// constitutes a parallel history store, so we have to clear it.
this.log(DBUG, "History cleared, reloading HTTPSRules to avoid information leak.");
HTTPSRules.init();
@@ -641,6 +642,19 @@ HTTPSEverywhere.prototype = {
return cohort;
},
+ // nsIChannelEventSink implementation
+ // XXX This was here for rewrites in the past. Do we still need it?
+ onChannelRedirect: function(oldChannel, newChannel, flags) {
+ const uri = newChannel.URI;
+ this.log(DBUG,"Got onChannelRedirect to "+uri.spec);
+ if (!(newChannel instanceof CI.nsIHttpChannel)) {
+ this.log(DBUG, newChannel + " is not an instance of nsIHttpChannel");
+ return;
+ }
+ var alist = this.juggleApplicableListsDuringRedirection(oldChannel, newChannel);
+ HTTPS.replaceChannel(alist, newChannel, this.httpNowhereEnabled);
+ },
+
juggleApplicableListsDuringRedirection: function(oldChannel, newChannel) {
// If the new channel doesn't yet have a list of applicable rulesets, start
// with the old one because that's probably a better representation of how
@@ -662,6 +676,11 @@ HTTPSEverywhere.prototype = {
return new_alist;
},
+ asyncOnChannelRedirect: function(oldChannel, newChannel, flags, callback) {
+ this.onChannelRedirect(oldChannel, newChannel, flags);
+ callback.onRedirectVerifyCallback(0);
+ },
+
get_prefs: function(prefBranch) {
if(!prefBranch) prefBranch = PREFBRANCH_ROOT;