diff --git a/api/js/etemplate/etemplate2.js b/api/js/etemplate/etemplate2.js index c6f6174c74..5389dec086 100644 --- a/api/js/etemplate/etemplate2.js +++ b/api/js/etemplate/etemplate2.js @@ -285,6 +285,9 @@ var etemplate2 = /** @class */ (function () { this.close_prompt = this._close_changed_prompt.bind(this); window.addEventListener("beforeunload", this.close_prompt); } + else if (window == egw_topWindow()) { + window.addEventListener("beforeunload", this.destroy_session); + } if (this._etemplate_exec_id) { this.destroy_session = jQuery.proxy(function (ev) { // need to use async === "keepalive" to run via beforeunload diff --git a/api/js/etemplate/etemplate2.ts b/api/js/etemplate/etemplate2.ts index df866d9b6f..91574b74dc 100644 --- a/api/js/etemplate/etemplate2.ts +++ b/api/js/etemplate/etemplate2.ts @@ -358,6 +358,10 @@ export class etemplate2 this.close_prompt = this._close_changed_prompt.bind(this); window.addEventListener("beforeunload", this.close_prompt); } + else if (window == egw_topWindow()) + { + window.addEventListener("beforeunload", this.destroy_session); + } if (this._etemplate_exec_id) { this.destroy_session = jQuery.proxy(function (ev)