diff --git a/background/background.js b/background/background.js index 74dbd8cd..d436bc13 100644 --- a/background/background.js +++ b/background/background.js @@ -150,11 +150,7 @@ prefs.subscribe([ 'badgeDisabled', 'badgeNormal', 'iconset', -], () => - queryTabs().then(tabs => - tabs.map(t => updateIcon({tab: t})) - ) -); +], () => debounce(updateAllTabsIcon)); // ************************************************************************* chrome.runtime.onInstalled.addListener(({reason}) => { @@ -534,3 +530,9 @@ function onRuntimeMessage(msg, sender, sendResponse) { respond(result); } } + +function updateAllTabsIcon() { + return queryTabs().then(tabs => + tabs.map(t => updateIcon({tab: t})) + ); +}