[torbutton/master] Bug 10285: Clear permissions on New Identity

commit 2418d8693fc6bd4b4a18aeb14cf39fd9cb660cf8 Author: Georg Koppen <g.koppen@jondos.de> Date: Mon Dec 9 14:48:38 2013 +0100 Bug 10285: Clear permissions on New Identity We should clear permissions on New Identity as e.g. the web notification permission would be able to link the old and the new session otherwise. --- src/chrome/content/torbutton.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/chrome/content/torbutton.js b/src/chrome/content/torbutton.js index b18dcda..07f5e19 100644 --- a/src/chrome/content/torbutton.js +++ b/src/chrome/content/torbutton.js @@ -1405,6 +1405,7 @@ function torbutton_new_identity() { * g. SSL Session IDs * h. last open location url * i. clear content prefs + * j. permissions * 3. Sends tor the NEWNYM signal to get a new circuit * 4. Opens a new window with the default homepage * 5. Closes this window @@ -1579,14 +1580,20 @@ function torbutton_do_new_identity() { createInstance(Ci.nsIContentPrefService); cps.removeGroupedPrefs(); } - + torbutton_log(3, "New Identity: Syncing prefs"); // Force prefs to be synced to disk var prefService = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefService); prefService.savePrefFile(null); - + + torbutton_log(3, "New Identity: Clearing permissions"); + + let pm = Cc["@mozilla.org/permissionmanager;1"]. + getService(Ci.nsIPermissionManager); + pm.removeAll(); + torbutton_log(3, "New Identity: Sending NEWNYM"); // We only support TBB for newnym.
participants (1)
-
mikeperry@torproject.org