[tor-commits] [torbutton/master] Bug 21747: 'New Tor Circuit for this Site' in ESR52
gk at torproject.org
gk at torproject.org
Tue Apr 4 10:04:56 UTC 2017
commit cfa9229fddb79067ebd3a0a6d8d0a10ab1bffc02
Author: Arthur Edelstein <arthuredelstein at gmail.com>
Date: Fri Mar 17 13:08:16 2017 -0700
Bug 21747: 'New Tor Circuit for this Site' in ESR52
Also, make sure we renew catchall "--unknown--" domain if user chooses
"New Tor Circuit" for about:addons, for example.
---
src/chrome/content/torbutton.js | 7 ++-----
src/components/domain-isolator.js | 3 +++
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/chrome/content/torbutton.js b/src/chrome/content/torbutton.js
index 970d2d0..9af7c57 100644
--- a/src/chrome/content/torbutton.js
+++ b/src/chrome/content/torbutton.js
@@ -1014,11 +1014,8 @@ function torbutton_send_ctrl_cmd(command) {
// Bug 1506 P4: Needed for New IP Address
function torbutton_new_circuit() {
- let thirdPartyUtil = Cc["@mozilla.org/thirdpartyutil;1"]
- .getService(Ci.mozIThirdPartyUtil);
-
- let firstPartyDomain = thirdPartyUtil
- .getFirstPartyHostForIsolation(gBrowser.currentURI);
+ let firstPartyDomain = gBrowser.contentPrincipal.originAttributes
+ .firstPartyDomain;
let domainIsolator = Cc["@torproject.org/domain-isolator;1"]
.getService(Ci.nsISupports).wrappedJSObject;
diff --git a/src/components/domain-isolator.js b/src/components/domain-isolator.js
index e43ee58..a52cccc 100644
--- a/src/components/domain-isolator.js
+++ b/src/components/domain-isolator.js
@@ -101,6 +101,9 @@ tor.nonce = function() {
tor.newCircuitForDomain = function(domain) {
// Re-generate the nonce for the domain.
+ if (domain === "") {
+ domain = "--unknown--";
+ }
tor.noncesForDomains[domain] = tor.nonce();
logger.eclog(3, "New domain isolation for " + domain + ": " + tor.noncesForDomains[domain]);
};
More information about the tor-commits
mailing list