@@ -32,16 +32,11 @@ const HTTPS = {
3232
3333 replaceChannel : function ( applicable_list , channel ) {
3434 var blob = HTTPSRules . rewrittenURI ( applicable_list , channel . URI ) ;
35- if ( null == blob ) {
36- //HTTPS.log(INFO,
37- // "Got replace channel with no applicable rules for URI "
38- // + channel.URI.spec);
39- return false ;
40- }
35+ if ( null == blob ) return false ; // no rewrite
4136 var uri = blob . newuri ;
4237 if ( ! uri ) this . log ( WARN , "OH NO BAD ARGH\nARGH" ) ;
4338
44- var c2 = channel . QueryInterface ( CI . nsIHttpChannel ) ;
39+ var c2 = channel . QueryInterface ( CI . nsIHttpChannel ) ;
4540 this . log ( DBUG , "Redirection limit is " + c2 . redirectionLimit ) ;
4641 // XXX This used to be (c2.redirectionLimit == 1), but that's very
4742 // inefficient in a case (eg amazon) where this may happen A LOT.
@@ -58,6 +53,7 @@ const HTTPS = {
5853 return false ;
5954 }
6055 if ( ChannelReplacement . supported ) {
56+ HTTPSEverywhere . instance . notifyObservers ( channel . URI , uri . spec ) ;
6157 HTTPS . log ( INFO , "Scheduling channel replacement for " + channel . URI . spec ) ;
6258 ChannelReplacement . runWhenPending ( channel , function ( ) {
6359 var cr = new ChannelReplacement ( channel , uri ) ;
@@ -77,7 +73,6 @@ const HTTPS = {
7773 // Strategy 1: replace the parts of the old_uri piecewise. Often this
7874 // works. In some cases it doesn't.
7975 this . log ( NOTE , "Rewriting " + old_uri . spec + " -> " + new_uri . spec + "\n" ) ;
80- HTTPSEverywhere . instance . notifyObservers ( old_uri , new_uri . spec ) ;
8176
8277 old_uri . scheme = new_uri . scheme ;
8378 old_uri . userPass = new_uri . userPass ;
@@ -131,6 +126,7 @@ const HTTPS = {
131126 var newuri = blob . newuri ;
132127
133128 try {
129+ HTTPSEverywhere . instance . notifyObservers ( uri , newuri . spec ) ;
134130 if ( this . rewriteInPlace ( uri , newuri ) )
135131 this . log ( INFO , "Forced URI " + uri . spec ) ;
136132 return true ;
0 commit comments