setBadgeText: skip pre-rendered tabs

This commit is contained in:
tophf 2017-07-22 07:39:43 +03:00
parent 3c298995f1
commit e463ca7ece

View File

@ -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});
}
}); });
}); });
} }