diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-07-18 08:24:24 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-07-18 08:24:24 +0200 |
commit | fc61780b35af913801d72086456f493f63197da6 (patch) | |
tree | f85891288a7bd988da9f0f15ae64e5c63f00d493 /toolkit/components/prompts/src/nsPrompter.js | |
parent | 69f7f9e5f1475891ce11cc4f431692f965b0cd30 (diff) | |
parent | 50d3e596bbe89c95615f96eb71f6bc5be737a1db (diff) | |
download | UXP-9ccb235f04529c1ec345d87dad6521cb567d20bb.tar UXP-9ccb235f04529c1ec345d87dad6521cb567d20bb.tar.gz UXP-9ccb235f04529c1ec345d87dad6521cb567d20bb.tar.lz UXP-9ccb235f04529c1ec345d87dad6521cb567d20bb.tar.xz UXP-9ccb235f04529c1ec345d87dad6521cb567d20bb.zip |
Merge commit '50d3e596bbe89c95615f96eb71f6bc5be737a1db' into Basilisk-releasev2018.07.18
# Conflicts:
# browser/app/profile/firefox.js
# browser/components/preferences/jar.mn
Diffstat (limited to 'toolkit/components/prompts/src/nsPrompter.js')
-rw-r--r-- | toolkit/components/prompts/src/nsPrompter.js | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/toolkit/components/prompts/src/nsPrompter.js b/toolkit/components/prompts/src/nsPrompter.js index 26efe28cc..0503b5925 100644 --- a/toolkit/components/prompts/src/nsPrompter.js +++ b/toolkit/components/prompts/src/nsPrompter.js @@ -369,7 +369,13 @@ function openTabPrompt(domWin, tabPrompt, args) { .getInterface(Ci.nsIDocShell); let inPermitUnload = docShell.contentViewer && docShell.contentViewer.inPermitUnload; let eventDetail = Cu.cloneInto({tabPrompt: true, inPermitUnload}, domWin); - PromptUtils.fireDialogEvent(domWin, "DOMWillOpenModalDialog", null, eventDetail); + let allowFocusSwitch = true; + try { + allowFocusSwitch = Services.prefs.getBoolPref("prompts.tab_modal.focusSwitch"); + } catch(e) {} + + if (allowFocusSwitch) + PromptUtils.fireDialogEvent(domWin, "DOMWillOpenModalDialog", null, eventDetail); let winUtils = domWin.QueryInterface(Ci.nsIInterfaceRequestor) .getInterface(Ci.nsIDOMWindowUtils); @@ -395,8 +401,8 @@ function openTabPrompt(domWin, tabPrompt, args) { frameMM.removeEventListener("pagehide", pagehide, true); winUtils.leaveModalState(); - - PromptUtils.fireDialogEvent(domWin, "DOMModalDialogClosed"); + if (allowFocusSwitch) + PromptUtils.fireDialogEvent(domWin, "DOMModalDialogClosed"); } frameMM.addEventListener("pagehide", pagehide, true); |