From f79f66ad341ec8f1183206ad6b5904b9e66082e8 Mon Sep 17 00:00:00 2001 From: Ximi1970 Date: Mon, 3 Aug 2020 23:40:03 +0200 Subject: [PATCH] Fix shutdown --- webext/js/windowEvent.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/webext/js/windowEvent.js b/webext/js/windowEvent.js index a8114c5..7f36b34 100644 --- a/webext/js/windowEvent.js +++ b/webext/js/windowEvent.js @@ -94,9 +94,8 @@ var { ExtensionSupport } = ChromeUtils.import( var windowListener = new (class extends ExtensionCommon.EventEmitter { constructor() { super(); - this.callbackCount = 0; this.callbackOnCloseButtonCount = 0; - this.hijackTitlebarCloseButtonCount = 0; + this.callbackOnLoadWindowCount = 0; this.MESSAGE_CLOSE_TYPE_DEFAULT = 0; this.MESSAGE_CLOSE_TYPE_MIN_MAIN_CLOSE_CHILDREN = 1; @@ -126,12 +125,12 @@ var windowListener = new (class extends ExtensionCommon.EventEmitter { "chrome://messenger/content/messenger.xul", ], onLoadWindow: function (window) { + windowListener.callbackOnLoadWindowCount++; if ( - windowListener.callbackOnCloseButtonCount < 2 || + windowListener.callbackOnLoadWindowCount === 1 || windowListener.closeType === windowListener.MESSAGE_CLOSE_TYPE_MIN_ALL ) { - windowListener.callbackOnCloseButtonCount++; window.addEventListener( "close", windowListener.onCloseButton,