@@ -57,32 +57,22 @@ const HTTPS = {
5757 }
5858
5959 // Check for the new internal redirect API. If it exists, use it.
60- if ( "redirectTo" in channel ) {
61- this . log ( INFO , "Using nsIHttpChannel.redirectTo: " + channel . URI . spec + " -> " + uri . spec ) ;
62- try {
63- channel . redirectTo ( uri ) ;
64- return true ;
65- } catch ( e ) {
66- // This should not happen. We should only get exceptions if
67- // the channel was already open.
68- this . log ( WARN , "Exception on nsIHttpChannel.redirectTo: " + e ) ;
69-
70- // Don't return: Fallback to NoScript ChannelReplacement.js
71- }
60+ if ( ! "redirectTo" in channel ) {
61+ this . log ( WARN , "nsIHTTPChannel.redirectTo API is missing. This version of HTTPS Everywhere is useless!!!!\n!!!\n" ) ;
62+ return false ;
7263 }
7364
74- if ( ChannelReplacement . supported ) {
75- HTTPSEverywhere . instance . notifyObservers ( channel . URI , uri . spec ) ;
76- HTTPS . log ( INFO , "Scheduling channel replacement for " + channel . URI . spec ) ;
77- ChannelReplacement . runWhenPending ( channel , function ( ) {
78- var cr = new ChannelReplacement ( channel , uri ) ;
79- cr . replace ( true , null ) ;
80- cr . open ( ) ;
81- HTTPS . log ( INFO , "Ran channel replacement for " + channel . URI . spec ) ;
82- } ) ;
65+ this . log ( INFO , "Using nsIHttpChannel.redirectTo: " + channel . URI . spec + " -> " + uri . spec ) ;
66+ try {
67+ channel . redirectTo ( uri ) ;
8368 return true ;
69+ } catch ( e ) {
70+ // This should not happen. We should only get exceptions if
71+ // the channel was already open.
72+ this . log ( WARN , "Exception on nsIHttpChannel.redirectTo: " + e ) ;
73+
74+ // Don't return: Fallback to NoScript ChannelReplacement.js
8475 }
85-
8676 this . log ( WARN , "Aborting redirection " + channel . name + ", should be HTTPS!" ) ;
8777 IOUtil . abort ( channel ) ;
8878 return false ;
0 commit comments