Skip to content

Commit 0bbbfbf

Browse files
committed
Improve some comments re: extension compatibility
1 parent 760f79d commit 0bbbfbf

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

src/chrome/content/code/HTTPS.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ const HTTPS = {
3838

3939
var c2 = channel.QueryInterface(CI.nsIHttpChannel);
4040
this.log(DBUG,"Redirection limit is " + c2.redirectionLimit);
41-
// XXX This used to be (c2.redirectionLimit == 1), but that's very
41+
// This used to be (c2.redirectionLimit == 1), but that's very
4242
// inefficient in a case (eg amazon) where this may happen A LOT.
43-
// Rather than number like 10, we should use the starting value
43+
// FIXME Rather than a number like 10, we should use the starting value
4444
// in network.http.redirection-limit minus some counter
4545
if (c2.redirectionLimit < 10) {
4646
this.log(WARN, "Redirection loop trying to set HTTPS on:\n " +
@@ -59,6 +59,9 @@ const HTTPS = {
5959
var cr = new ChannelReplacement(channel, uri);
6060
cr.replace(true,null);
6161
cr.open();
62+
// XXX If we had a way to tell other extensions that we were replacing
63+
// their channels, perhaps this would be a good place to do it?
64+
// https://trac.torproject.org/projects/tor/ticket/3190
6265
HTTPS.log(INFO,"Ran channel replacement for "+channel.URI.spec);
6366
});
6467
return true;
@@ -112,10 +115,10 @@ const HTTPS = {
112115
},
113116

114117
forceURI: function(uri, fallback, ctx) {
115-
// Switch some uris to https; ctx is either nsIDOMNode or nsIDOMWindow as
116-
// per the ContentPolicy API.
117-
// Returns true if everything worked out (either correct replacement or no
118-
// replacement needed). Retun False if all attempts to rewrite failed.
118+
// Switch some uris to https; ctx is either nsIDOMNode or nsIDOMWindow as
119+
// per the ContentPolicy API.
120+
// Returns true if everything worked out (either correct replacement or no
121+
// replacement needed). Retun False if all attempts to rewrite failed.
119122

120123
// first of all we need to get the applicable rules list to keep track of
121124
// what rulesets might have applied to this page

src/components/https-everywhere.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,11 @@ HTTPSEverywhere.prototype = {
606606
},
607607

608608
/**
609-
* Notify observers of the topic OBSERVER_TOPIC_URI_REWRITE.
609+
* Notify observers of the topic OBSERVER_TOPIC_URI_REWRITE. Intended for
610+
* extension compatibility:
611+
*
612+
* https://trac.torproject.org/projects/tor/ticket/1574
613+
* https://trac.torproject.org/projects/tor/ticket/3190
610614
*
611615
* @param nsIURI oldURI
612616
* @param string newSpec

0 commit comments

Comments
 (0)