[or-cvs] [https-everywhere/master 2/4] Bring HTTPS.js up to noscript 2.0.5.1.

pde at torproject.org pde at torproject.org
Fri Nov 12 00:00:48 UTC 2010


Author: Mike Perry <mikeperry-git fscked org>
Date: Thu, 11 Nov 2010 12:55:45 -0800
Subject: Bring HTTPS.js up to noscript 2.0.5.1.
Commit: 66096d19fed8072f072d85906751562cf69d6cf3

---
 src/chrome/content/code/HTTPS.js |   27 ++-------------------------
 1 files changed, 2 insertions(+), 25 deletions(-)

diff --git a/src/chrome/content/code/HTTPS.js b/src/chrome/content/code/HTTPS.js
index ef4571f..bf0c1d4 100644
--- a/src/chrome/content/code/HTTPS.js
+++ b/src/chrome/content/code/HTTPS.js
@@ -29,11 +29,7 @@ const HTTPS = {
   httpsRewrite: null,
   
   forceChannel: function(channel) {
-    if (channel.loadFlags & CI.nsIRequest.LOAD_BACKGROUND) {
-      HTTPS.log(INFO, "Background request.. Forcing channel replacement.");
-      return HTTPS.replaceChannel(channel);
-    }
-    return this.forceURI(channel.URI, function() { return HTTPS.replaceChannel(channel); });
+    return HTTPS.replaceChannel(channel);
   },
   
   replaceChannel: function(channel) {
@@ -60,27 +56,8 @@ const HTTPS = {
     if (ChannelReplacement.supported) {
       HTTPS.log(INFO,"Scheduling channel replacement for "+channel.URI.spec);
       IOUtil.runWhenPending(channel, function() {
-        // replacing a shortcut icon causes a cache-related crash like
-        // https://bugzilla.mozilla.org/show_bug.cgi?id=480352
-        // just abort it... 
-        // XXX This is crazy NoScript code, but the crash it prevents is
-        // reproducible.  Unfortunately, there is a race condition between
-        // this nsIcontentobserver case and the contentpolicy code that is
-        // supposed to get to non-favicon images first, and so some real
-        // non-favicons get caught in this codepath.  
-        // Also unfortunatley, we don't know a better way to distinguish
-        // between favicons and non-favicon images.  Testing path==favicon.ico
-        // MIGHT work, but we don't want to risk that investigation yet.
-        try {
-         if (/\bimage\//.test(channel.getRequestHeader("Accept")) &&
-             !PolicyState.extract(channel) // favicons don't trigger content policies
-            ) {
-           HTTPS.log(WARN,"Aborting possible favicon " + channel.name + ", should be HTTPS!");
-           IOUtil.abort(channel);
-           return;
-         }
-        } catch(e) {}
         new ChannelReplacement(channel, uri).replace(true).open();
+        HTTPS.log(INFO,"Ran channel replacement for "+channel.URI.spec);
       });
       return true;
     }
-- 
1.7.1




More information about the tor-commits mailing list