mirror of
https://github.com/zen-browser/components.git
synced 2025-07-07 23:49:58 +02:00
Refactor ZenGlanceManager.mjs to handle quitting application when closing glance
This commit is contained in:
parent
458bb54a34
commit
220c9b42a5
1 changed files with 9 additions and 1 deletions
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
document.getElementById('tabbrowser-tabpanels').addEventListener("click", this.onOverlayClick.bind(this));
|
document.getElementById('tabbrowser-tabpanels').addEventListener("click", this.onOverlayClick.bind(this));
|
||||||
|
|
||||||
window.addEventListener("beforeunload", this.onUnload.bind(this));
|
Services.obs.addObserver(this, "quit-application-requested");
|
||||||
}
|
}
|
||||||
|
|
||||||
onKeyDown(event) {
|
onKeyDown(event) {
|
||||||
|
@ -36,6 +36,14 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
observe(subject, topic) {
|
||||||
|
switch (topic) {
|
||||||
|
case "quit-application-requested":
|
||||||
|
this.onUnload();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onUnload() {
|
onUnload() {
|
||||||
// clear everything
|
// clear everything
|
||||||
if (this.#currentBrowser) {
|
if (this.#currentBrowser) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue