diff options
author | Ruben Rodriguez <ruben@gnu.org> | 2016-05-10 19:16:58 -0400 |
---|---|---|
committer | Ruben Rodriguez <ruben@gnu.org> | 2016-05-10 19:16:58 -0400 |
commit | 789ffd1155c1cc9f4fa7f719346d68cfabada800 (patch) | |
tree | 09365dd814afec3aa2df506e286b1060eef70491 /data/extensions/https-everywhere-eff@eff.org/chrome/content/code/HTTPS.js | |
parent | 6ec779969597671308c74e812d48604ddde81495 (diff) |
HTTPS-Everywhere updated to 5.1.6
Diffstat (limited to 'data/extensions/https-everywhere-eff@eff.org/chrome/content/code/HTTPS.js')
-rw-r--r-- | data/extensions/https-everywhere-eff@eff.org/chrome/content/code/HTTPS.js | 48 |
1 files changed, 1 insertions, 47 deletions
diff --git a/data/extensions/https-everywhere-eff@eff.org/chrome/content/code/HTTPS.js b/data/extensions/https-everywhere-eff@eff.org/chrome/content/code/HTTPS.js index 3053014..c5834dd 100644 --- a/data/extensions/https-everywhere-eff@eff.org/chrome/content/code/HTTPS.js +++ b/data/extensions/https-everywhere-eff@eff.org/chrome/content/code/HTTPS.js @@ -39,53 +39,7 @@ const HTTPS = { * untouched or aborted. */ replaceChannel: function(applicable_list, channel, httpNowhereEnabled) { - var that = this; - // If the callback gets called immediately (not async), it will be called - // before the return from the function sets this variable, so we default it - // to true. - var callbackedImmediate = true; - callbackedImmediate = HTTPSRules.rewrittenURI(applicable_list, channel.URI.clone(), function(blob) { - if (callbackedImmediate) { - that.replaceChannelCallback(applicable_list, channel, httpNowhereEnabled, blob); - } else { - // If we can't redirect right away because we're waiting on some disk - // I/O to read the rules, we will have told the channel to redirect to - // itself and suspend, to insure it doesn't actually open while it's - // waiting for us to decide what to do. See - // https://bugzilla.mozilla.org/show_bug.cgi?id=1170197. - // Now that we're in the callback, we know the rules are loaded. So we - // tell the channel to go ahead and continue with the redirect-to-self. - // That will trigger on-modify-request again, and we'll wind up here - // again, except with the rules already loaded. We don't try a - // redirectTo here because it would fail with NS_ERROR_IN_PROGRESS. - try { - channel.resume(); - } catch (e) { - that.log(WARN, 'Failed to resume ' + channel.URI.spec + ': ' + e); - return; - } - that.log(DBUG, 'Succeeded resuming ' + channel.URI.spec + ' '); - } - }); - if (!callbackedImmediate) { - try { - channel.redirectTo(channel.URI); - } catch (e) { - this.log(WARN, 'Failed to redirect to self ' + channel.URI.spec + ': ' + e); - return; - } - try { - channel.suspend(); - } catch (e) { - this.log(WARN, 'Failed to suspend ' + channel.URI.spec + ': ' + e); - return; - } - this.log(DBUG, 'Succeeded suspending ' + channel.URI.spec); - } - }, - - replaceChannelCallback: function(applicable_list, channel, httpNowhereEnabled, blob, callbackedImmediate) { - var that = this; + var blob = HTTPSRules.rewrittenURI(applicable_list, channel.URI.clone()); var isSTS = securityService.isSecureURI( CI.nsISiteSecurityService.HEADER_HSTS, channel.URI, 0); if (blob === null) { |