fixup e463ca7e: use the actual tab index

This commit is contained in:
tophf 2017-07-22 16:57:52 +03:00
parent 93ff6d0f85
commit b37b2c5246

View File

@ -280,9 +280,9 @@ 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(realTab => {
// skip pre-rendered tabs // skip pre-rendered tabs
if (tab.index >= 0) { if (realTab.index >= 0) {
chrome.browserAction.setBadgeText({text, tabId: tab.id}); chrome.browserAction.setBadgeText({text, tabId: tab.id});
} }
}); });