mirror of
https://github.com/zen-browser/desktop.git
synced 2025-10-06 01:46:35 +00:00
Add tab icon change handling and enhance tab background styles
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user