[tor-commits] [torbutton/master] Bug 19689: Plugin prompt is parented to wrong window

gk at torproject.org gk at torproject.org
Sun Jul 17 09:34:01 UTC 2016


commit 2146d7700159bb1d836be14a96f9f3b335398056
Author: Kathy Brade <brade at pearlcrescent.com>
Date:   Fri Jul 15 11:46:20 2016 -0400

    Bug 19689: Plugin prompt is parented to wrong window
    
    When displaying the "Are you sure you want to enable plugins?" prompt,
    always use the top-most browser window as the parent window. This avoids
    problems caused by using the Privacy and Security Settings dialog, which
    is closing, as the parent.
---
 src/chrome/content/torbutton.js | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/chrome/content/torbutton.js b/src/chrome/content/torbutton.js
index f69fd8a..6e874b5 100644
--- a/src/chrome/content/torbutton.js
+++ b/src/chrome/content/torbutton.js
@@ -710,7 +710,10 @@ function torbutton_confirm_plugins() {
   var askAgainText = torbutton_get_property_string("torbutton.popup.never_ask_again");
   var askAgain = {value: false};
 
-  var no_plugins = (prompts.confirmEx(null, "", message, flags, null, null, null,
+  var wm = Cc["@mozilla.org/appshell/window-mediator;1"]
+             .getService(Components.interfaces.nsIWindowMediator);
+  var win = wm.getMostRecentWindow("navigator:browser");
+  var no_plugins = (prompts.confirmEx(win, "", message, flags, null, null, null,
       askAgainText, askAgain) == 1);
 
   m_tb_prefs.setBoolPref("extensions.torbutton.confirm_plugins", !askAgain.value);



More information about the tor-commits mailing list