From e463ca7ece2fc2deb6b6fe3df6de4d0da4cf8dbd Mon Sep 17 00:00:00 2001 From: tophf Date: Sat, 22 Jul 2017 07:39:43 +0300 Subject: [PATCH] setBadgeText: skip pre-rendered tabs --- background/background.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/background/background.js b/background/background.js index 13d12e2f..643cba2c 100644 --- a/background/background.js +++ b/background/background.js @@ -281,7 +281,10 @@ function updateIcon(tab, styles) { // Vivaldi bug workaround: setBadgeText must follow setBadgeBackgroundColor chrome.browserAction.setBadgeBackgroundColor({color}); getTab(tab.id).then(() => { - chrome.browserAction.setBadgeText({text, tabId: tab.id}); + // skip pre-rendered tabs + if (tab.index >= 0) { + chrome.browserAction.setBadgeText({text, tabId: tab.id}); + } }); }); }