mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-22 23:27:30 +09:00
Re-implement prompts.tab_modal.focusSwitch control in toolkit.
This commit is contained in:
parent
343a51f1a1
commit
21ea79484b
1 changed files with 9 additions and 3 deletions
|
|
@ -369,6 +369,12 @@ function openTabPrompt(domWin, tabPrompt, args) {
|
||||||
.getInterface(Ci.nsIDocShell);
|
.getInterface(Ci.nsIDocShell);
|
||||||
let inPermitUnload = docShell.contentViewer && docShell.contentViewer.inPermitUnload;
|
let inPermitUnload = docShell.contentViewer && docShell.contentViewer.inPermitUnload;
|
||||||
let eventDetail = Cu.cloneInto({tabPrompt: true, inPermitUnload}, domWin);
|
let eventDetail = Cu.cloneInto({tabPrompt: true, inPermitUnload}, domWin);
|
||||||
|
let allowFocusSwitch = true;
|
||||||
|
try {
|
||||||
|
allowFocusSwitch = Services.prefs.getBoolPref("prompts.tab_modal.focusSwitch");
|
||||||
|
} catch(e) {}
|
||||||
|
|
||||||
|
if (allowFocusSwitch)
|
||||||
PromptUtils.fireDialogEvent(domWin, "DOMWillOpenModalDialog", null, eventDetail);
|
PromptUtils.fireDialogEvent(domWin, "DOMWillOpenModalDialog", null, eventDetail);
|
||||||
|
|
||||||
let winUtils = domWin.QueryInterface(Ci.nsIInterfaceRequestor)
|
let winUtils = domWin.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||||
|
|
@ -395,7 +401,7 @@ function openTabPrompt(domWin, tabPrompt, args) {
|
||||||
frameMM.removeEventListener("pagehide", pagehide, true);
|
frameMM.removeEventListener("pagehide", pagehide, true);
|
||||||
|
|
||||||
winUtils.leaveModalState();
|
winUtils.leaveModalState();
|
||||||
|
if (allowFocusSwitch)
|
||||||
PromptUtils.fireDialogEvent(domWin, "DOMModalDialogClosed");
|
PromptUtils.fireDialogEvent(domWin, "DOMModalDialogClosed");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue