[tbb-commits] [torbutton/master] Bug 15927: Force update of the NoScript UI

gk at torproject.org gk at torproject.org
Wed May 6 12:48:42 UTC 2015


commit fecc621d6c3928918b4c62071f41ac2e4287e121
Author: Mike Perry <mikeperry-git at torproject.org>
Date:   Tue May 5 00:22:15 2015 -0700

    Bug 15927: Force update of the NoScript UI
---
 src/chrome/content/torbutton.js |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/src/chrome/content/torbutton.js b/src/chrome/content/torbutton.js
index 21e567e..c580c59 100644
--- a/src/chrome/content/torbutton.js
+++ b/src/chrome/content/torbutton.js
@@ -2378,6 +2378,22 @@ function torbutton_update_security_slider() {
       }
       break;
   }
+  /* Update the NoScript button to reflect any changes */
+  try {
+      let wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
+                         .getService(Components.interfaces.nsIWindowMediator);
+      let browserEnumerator = wm.getEnumerator("navigator:browser");
+
+      // Update every window's NoScript status...
+      while (browserEnumerator.hasMoreElements()) {
+          let win = browserEnumerator.getNext();
+          win.noscriptOverlay._syncUINow();
+      }
+      torbutton_log(3, 'Updated NoScript status for security slider');
+  } catch(e) {
+      torbutton_log(4, 'Failed to update NoScript status for security slider: '+e);
+  }
+  torbutton_log(3, 'Security Slider Pref Update Complete');
   m_tb_sliderUpdate = false;
 }
 



More information about the tbb-commits mailing list