diff --git a/background/background.js b/background/background.js index cb25bbfe..a0ae97fe 100644 --- a/background/background.js +++ b/background/background.js @@ -119,22 +119,15 @@ prefs.subscribe(['iconset'], () => })); // ************************************************************************* -{ - const onInstall = ({reason}) => { - chrome.runtime.onInstalled.removeListener(onInstall); - if (reason === 'update') { - // translations may change - localStorage.L10N = JSON.stringify({ - browserUIlanguage: chrome.i18n.getUILanguage(), - }); - // themes may change - delete localStorage.codeMirrorThemes; - } - }; - // bind for 60 seconds max and auto-unbind if it's a normal run - chrome.runtime.onInstalled.addListener(onInstall); - setTimeout(onInstall, 60e3, {reason: 'unbindme'}); -} +chrome.runtime.onInstalled.addListener(({reason}) => { + if (reason !== 'update') return; + // translations may change + localStorage.L10N = JSON.stringify({ + browserUIlanguage: chrome.i18n.getUILanguage(), + }); + // themes may change + delete localStorage.codeMirrorThemes; +}); // ************************************************************************* // browser commands