diff --git a/background.js b/background.js index 63d0924a..bea7653b 100644 --- a/background.js +++ b/background.js @@ -205,19 +205,9 @@ chrome.storage.local.get('version', prefs => { } }); -// after the extension was enabled or just installed -// reason = 'update' is needed becase our listener processes only 'update' events -injectContentScripts({reason: 'update'}); +injectContentScripts(); -// after an actual update -chrome.runtime.onInstalled.addListener(injectContentScripts); - -function injectContentScripts({reason, previousVersion, id} = {}) { - // reason: install, update, chrome_update, shared_module_update - // the "install" case is ignored because it was already handled by explicit invocation of this function - if (!/update/.test(reason)) { - return; - } +function injectContentScripts() { const contentScripts = chrome.app.getDetails().content_scripts; for (let cs of contentScripts) { cs.matches = cs.matches.map(m => m == '' ? m : wildcardAsRegExp(m));