Add tab icon change handling and enhance tab background styles

This commit is contained in:
mr. M
2025-01-11 22:54:04 +01:00
parent 619f979232
commit e26ff172c8
4 changed files with 167 additions and 25 deletions

View File

@@ -68,6 +68,13 @@
await this._refreshPinnedTabs(newWorkspace, { init: onInit });
}
onTabIconChanged(tab, url = null) {
const iconUrl = url ?? tab.iconImage.src;
if (tab.hasAttribute('zen-essential')) {
tab.querySelector('.tab-background').style.setProperty('--zen-tab-icon', `url(${iconUrl})`);
}
}
get enabled() {
if (typeof this._enabled === 'undefined') {
this._enabled = !(
@@ -544,6 +551,7 @@
gBrowser.unpinTab(tab);
}
gBrowser.pinTab(tab);
this.onTabIconChanged(tab);
}
}