mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 908304: Wait until confirm window closes before installing add-ons; r=Unfocused
This commit is contained in:
parent
faadc15543
commit
edbf9e57d2
@ -4,8 +4,6 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
var args
|
||||
|
||||
var XPInstallConfirm = {};
|
||||
|
||||
XPInstallConfirm.init = function XPInstallConfirm_init()
|
||||
@ -15,9 +13,12 @@ XPInstallConfirm.init = function XPInstallConfirm_init()
|
||||
var _focused;
|
||||
var _timeout;
|
||||
|
||||
// Default to cancelling the install when the window unloads
|
||||
XPInstallConfirm._installOK = false;
|
||||
|
||||
var bundle = document.getElementById("xpinstallConfirmStrings");
|
||||
|
||||
args = window.arguments[0].wrappedJSObject;
|
||||
let args = window.arguments[0].wrappedJSObject;
|
||||
|
||||
var _installCountdownLength = 5;
|
||||
try {
|
||||
@ -122,6 +123,17 @@ XPInstallConfirm.init = function XPInstallConfirm_init()
|
||||
document.removeEventListener("focus", myfocus, true);
|
||||
document.removeEventListener("blur", myblur, true);
|
||||
window.removeEventListener("unload", myUnload, false);
|
||||
|
||||
// Now perform the desired action - either install the
|
||||
// addons or cancel the installations
|
||||
if (XPInstallConfirm._installOK) {
|
||||
for (let install of args.installs)
|
||||
install.install();
|
||||
}
|
||||
else {
|
||||
for (let install of args.installs)
|
||||
install.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
if (_installCountdownLength > 0) {
|
||||
@ -142,14 +154,14 @@ XPInstallConfirm.onOK = function XPInstallConfirm_onOk()
|
||||
getService(Components.interfaces.nsITelemetry).
|
||||
getHistogramById("SECURITY_UI").
|
||||
add(Components.interfaces.nsISecurityUITelemetry.WARNING_CONFIRM_ADDON_INSTALL_CLICK_THROUGH);
|
||||
for (let install of args.installs)
|
||||
install.install();
|
||||
// Perform the install or cancel after the window has unloaded
|
||||
XPInstallConfirm._installOK = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
XPInstallConfirm.onCancel = function XPInstallConfirm_onCancel()
|
||||
{
|
||||
for (let install of args.installs)
|
||||
install.cancel();
|
||||
// Perform the install or cancel after the window has unloaded
|
||||
XPInstallConfirm._installOK = false;
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user