diff --git a/background.js b/background.js index 7b9daa43..4a9bb27b 100644 --- a/background.js +++ b/background.js @@ -47,6 +47,11 @@ if ('commands' in chrome) { chrome.commands.onCommand.addListener(command => browserCommands[command]()); } +// ************************************************************************* +// set the default icon displayed after a tab is created until webNavigation kicks in +prefs.subscribe(() => updateIcon({id: undefined}, {}), ['iconset']); +updateIcon({id: undefined}, {}); + // ************************************************************************* { const onInstall = ({reason}) => { @@ -272,7 +277,7 @@ function updateIcon(tab, styles) { // TODO: add Edge preferred sizes: 20, 25, 30, 40 }, }, () => { - if (chrome.runtime.lastError) { + if (chrome.runtime.lastError || tab.id === undefined) { return; } // Vivaldi bug workaround: setBadgeText must follow setBadgeBackgroundColor