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

gk at torproject.org gk at torproject.org
Sun Jul 17 09:36:18 UTC 2016


commit f5fa0465dfa666b0bdbfc7e1d0cc51be68680245
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 539bd88..eb73b8c 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