Refactor ZenGlanceManager.mjs to simplify closing of glance and handle quitting application

This commit is contained in:
mr. M 2024-11-02 19:00:04 +01:00
parent 9b4b399c59
commit 0e8a452071
No known key found for this signature in database
GPG key ID: CBD57A2AEDBDA1FB
2 changed files with 2 additions and 1 deletions

View file

@ -189,6 +189,7 @@
this.lastCurrentTab.removeAttribute("zen-glance-tab");
gBrowser.tabContainer._invalidateCachedTabs();
this.lastCurrentTab.closing = true;
gBrowser.removeTab(this.lastCurrentTab, { animate: false });
this.#currentTab = null;

View file

@ -288,7 +288,7 @@
async addCustomColor() {
const color = this.customColorInput.value;
if (!color) {
if (!color || !color.match(/^#[0-9a-f]{3,6}$/i)) {
return;
}
// can be any color format, we just add it to the list as a dot, but hidden