Ticket #5477: UseRedirectAPI.patch

File UseRedirectAPI.patch, 742 bytes (added by mikeperry, 7 years ago)

Patch for HTTPS-Everywhere to use the new redirect API (if it exists).

  • src/chrome/content/code/HTTPS.js

    diff --git a/src/chrome/content/code/HTTPS.js b/src/chrome/content/code/HTTPS.js
    index 3b497d6..533a0bc 100644
    a b const HTTPS = { 
    5252      https_everywhere_blacklist[channel.URI.spec] = blob.applied_ruleset;
    5353      return false;
    5454    }
     55    if ("asyncRedirect" in channel) {
     56      this.log(WARN, "Found AsyncRedirect!");
     57      channel.asyncRedirect(uri);
     58      this.log(WARN, "Did AsyncRedirect for: "+uri.spec);
     59      return true;
     60    }
     61
    5562    if (ChannelReplacement.supported) {
    5663      HTTPSEverywhere.instance.notifyObservers(channel.URI, uri.spec);
    5764      HTTPS.log(INFO,"Scheduling channel replacement for "+channel.URI.spec);