diff options
author | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-07-06 15:53:52 +0200 |
---|---|---|
committer | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-07-06 15:53:52 +0200 |
commit | 941e54654eabed0a3568f7fefe424a45aa02eddb (patch) | |
tree | 49aa02b174c428962d99142d8061267bfcd79e69 /toolkit/components/prompts/src | |
parent | ad9ee72dcd7981bc47b3844a224d69fadfdfd8ef (diff) | |
parent | 0daa12376295d5d796256a116eb2a348a3a9273f (diff) | |
download | UXP-941e54654eabed0a3568f7fefe424a45aa02eddb.tar UXP-941e54654eabed0a3568f7fefe424a45aa02eddb.tar.gz UXP-941e54654eabed0a3568f7fefe424a45aa02eddb.tar.lz UXP-941e54654eabed0a3568f7fefe424a45aa02eddb.tar.xz UXP-941e54654eabed0a3568f7fefe424a45aa02eddb.zip |
Merge branch 'master' of https://github.com/MoonchildProductions/UXP into _testBranch_test_1
Diffstat (limited to 'toolkit/components/prompts/src')
-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); |