fixup! call updateCount explicitly on extension pages

This commit is contained in:
tophf 2020-02-24 15:31:03 +03:00
parent 8903446e44
commit 054df4fe27

View File

@ -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 // 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; 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 // save it now because chrome.runtime will be unavailable in the orphaned script
const orphanEventId = chrome.runtime.id; const orphanEventId = chrome.runtime.id;