diff options
author | FranklinDM <mrmineshafter17@gmail.com> | 2022-03-14 21:23:32 +0800 |
---|---|---|
committer | FranklinDM <mrmineshafter17@gmail.com> | 2022-11-23 17:56:50 +0800 |
commit | 7001a57aefa1b86ebe361436c2cfae62c8af0835 (patch) | |
tree | 47f8d59056565505fe4407cb6f1266dfa56f7e4e /toolkit/mozapps/handling/nsContentDispatchChooser.js | |
parent | 173320cf7d173246885546c0292f0ef7b964d894 (diff) | |
download | uxp-7001a57aefa1b86ebe361436c2cfae62c8af0835.tar.gz |
Issue #2029 - Part 1: Add preference for opening the protocol handling dialog as window modal
This adds the preference, `prompts.content_handling_dialog_modal.enabled`, to control whether the dialog is window modal or not.
Diffstat (limited to 'toolkit/mozapps/handling/nsContentDispatchChooser.js')
-rw-r--r-- | toolkit/mozapps/handling/nsContentDispatchChooser.js | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/toolkit/mozapps/handling/nsContentDispatchChooser.js b/toolkit/mozapps/handling/nsContentDispatchChooser.js index e02545594c..95111afc1b 100644 --- a/toolkit/mozapps/handling/nsContentDispatchChooser.js +++ b/toolkit/mozapps/handling/nsContentDispatchChooser.js @@ -6,9 +6,8 @@ Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); // Constants -const Cc = Components.classes; -const Ci = Components.interfaces; -const Cr = Components.results; +const {utils: Cu, interfaces: Ci, classes: Cc, results: Cr} = Components; +Cu.import("resource://gre/modules/Services.jsm"); const CONTENT_HANDLING_URL = "chrome://mozapps/content/handling/dialog.xul"; const STRINGBUNDLE_URL = "chrome://mozapps/locale/handling/handling.properties"; @@ -64,13 +63,14 @@ nsContentDispatchChooser.prototype = params.appendElement(aURI, false); params.appendElement(aWindowContext, false); + var features = "chrome,dialog=yes,resizable,centerscreen"; + if (Services.prefs.getBoolPref("prompts.content_handling_dialog_modal.enabled")) { + features += ",modal"; + } + var ww = Cc["@mozilla.org/embedcomp/window-watcher;1"]. getService(Ci.nsIWindowWatcher); - ww.openWindow(window, - CONTENT_HANDLING_URL, - null, - "chrome,dialog=yes,resizable,centerscreen", - params); + ww.openWindow(window, CONTENT_HANDLING_URL, null, features, params); }, // nsISupports |