setBadgeText: skip pre-rendered tabs
This commit is contained in:
parent
3c298995f1
commit
e463ca7ece
|
@ -281,7 +281,10 @@ function updateIcon(tab, styles) {
|
||||||
// Vivaldi bug workaround: setBadgeText must follow setBadgeBackgroundColor
|
// Vivaldi bug workaround: setBadgeText must follow setBadgeBackgroundColor
|
||||||
chrome.browserAction.setBadgeBackgroundColor({color});
|
chrome.browserAction.setBadgeBackgroundColor({color});
|
||||||
getTab(tab.id).then(() => {
|
getTab(tab.id).then(() => {
|
||||||
|
// skip pre-rendered tabs
|
||||||
|
if (tab.index >= 0) {
|
||||||
chrome.browserAction.setBadgeText({text, tabId: tab.id});
|
chrome.browserAction.setBadgeText({text, tabId: tab.id});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user