Skip to content
This repository was archived by the owner on Nov 6, 2023. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 1 addition & 41 deletions src/components/https-everywhere.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,7 @@ HTTPSEverywhere.prototype = {
QueryInterface: XPCOMUtils.generateQI(
[ Components.interfaces.nsIObserver,
Components.interfaces.nsISupports,
Components.interfaces.nsISupportsWeakReference,
Components.interfaces.nsIChannelEventSink ]),
Components.interfaces.nsISupportsWeakReference ]),

wrappedJSObject: null, // Initialized by constructor

Expand Down Expand Up @@ -642,45 +641,6 @@ 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
// secure the load process was for this page
var browser = this.getBrowserForChannel(oldChannel);
var old_alist = null;
if (browser)
old_alist = this.getExpando(browser,"applicable_rules");
browser = this.getBrowserForChannel(newChannel);
if (!browser) return null;
var new_alist = this.getExpando(browser,"applicable_rules");
if (old_alist && !new_alist) {
new_alist = old_alist;
this.setExpando(browser,"applicable_rules",new_alist);
} else if (!new_alist) {
new_alist = new ApplicableList(this.log, browser.currentURI);
this.setExpando(browser,"applicable_rules",new_alist);
}
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;

Expand Down