[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

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



commit fecc621d6c3928918b4c62071f41ac2e4287e121
Author: Mike Perry <mikeperry-git@xxxxxxxxxxxxxx>
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;
 }
 

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits