diff --git a/webext/js/windowEvent.js b/webext/js/windowEvent.js index a633a0f..816bf8c 100644 --- a/webext/js/windowEvent.js +++ b/webext/js/windowEvent.js @@ -62,6 +62,8 @@ var windowListener = new (class extends ExtensionCommon.EventEmitter { this.MESSAGE_CLOSE_TYPE_DEFAULT = 0; this.MESSAGE_CLOSE_TYPE_MIN_MAIN_CLOSE_CHILDREN = 1; this.MESSAGE_CLOSE_TYPE_MIN_ALL = 2; + this.MESSAGE_CLOSE_TYPE_MIN_MAIN_TRAY_CLOSE_CHILDREN = 3; + this.MESSAGE_CLOSE_TYPE_MIN_ALL_TRAY = 4; this.closeType = this.MESSAGE_CLOSE_TYPE_MIN_MAIN_CLOSE_CHILDREN; } @@ -73,6 +75,10 @@ var windowListener = new (class extends ExtensionCommon.EventEmitter { this.closeType = this.MESSAGE_CLOSE_TYPE_MIN_MAIN_CLOSE_CHILDREN; } else if (closeType === 2) { this.closeType = this.MESSAGE_CLOSE_TYPE_MIN_ALL; + } else if (closeType === 3) { + this.closeType = this.MESSAGE_CLOSE_TYPE_MIN_MAIN_TRAY_CLOSE_CHILDREN; + } else if (closeType === 4) { + this.closeType = this.MESSAGE_CLOSE_TYPE_MIN_ALL_TRAY; } else console.log("Unknown close type: " + closeType); } @@ -91,7 +97,9 @@ var windowListener = new (class extends ExtensionCommon.EventEmitter { if ( windowListener.callbackOnLoadWindowCount === 1 || windowListener.closeType === - windowListener.MESSAGE_CLOSE_TYPE_MIN_ALL + windowListener.MESSAGE_CLOSE_TYPE_MIN_ALL || + windowListener.closeType === + windowListener.MESSAGE_CLOSE_TYPE_MIN_ALL_TRAY ) { window.addEventListener( "close", diff --git a/webext/schema_windowEvent.json b/webext/schema_windowEvent.json index a8a4c47..6a5495f 100644 --- a/webext/schema_windowEvent.json +++ b/webext/schema_windowEvent.json @@ -12,7 +12,7 @@ "type": "integer", "name": "type", "minimum": 0, - "maximum": 2 + "maximum": 4 } ] }