diff --git a/content/apply.js b/content/apply.js index 97a3f819..0e0d098a 100644 --- a/content/apply.js +++ b/content/apply.js @@ -18,7 +18,12 @@ self.INJECTED !== 1 && (() => { // if chrome.tabs is absent it's a web page, otherwise we'll check for popup/options as those aren't tabs let isTab = !chrome.tabs; - if (chrome.tabs) chrome.tabs.getCurrent(tab => (isTab = Boolean(tab))); + if (chrome.tabs) { + chrome.tabs.getCurrent(tab => { + isTab = Boolean(tab); + if (tab && styleInjector.list.length) updateCount(); + }); + } // save it now because chrome.runtime will be unavailable in the orphaned script const orphanEventId = chrome.runtime.id;