diff options
Diffstat (limited to 'src/background.ts')
-rw-r--r-- | src/background.ts | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/background.ts b/src/background.ts index 23914f46..a5a70219 100644 --- a/src/background.ts +++ b/src/background.ts @@ -7,13 +7,9 @@ import { sendRealRequestToCustomServer, setupBackgroundRequestProxy } from "../m import { setupTabUpdates } from "../maze-utils/src/tab-updates"; import { generateUserID } from "../maze-utils/src/setup"; -// Make the config public for debugging purposes - -window.SB = Config; - import Utils from "./utils"; import { getExtensionIdsToImportFrom } from "./utils/crossExtension"; -import { isFirefoxOrSafari } from "../maze-utils/src"; +import { isFirefoxOrSafari, waitFor } from "../maze-utils/src"; import { injectUpdatedScripts } from "../maze-utils/src/cleanup"; import { logWarn } from "./utils/logger"; import { chromeP } from "../maze-utils/src/browserApi"; @@ -142,9 +138,16 @@ chrome.runtime.onInstalled.addListener(function () { } }, 1500); - // Only do this once the old version understands how to clean itself up - if (!isFirefoxOrSafari() && chrome.runtime.getManifest().version !== "5.4.13") { + if (!isFirefoxOrSafari()) { injectUpdatedScripts().catch(logWarn); + + waitFor(() => Config.isReady()).then(() => { + if (Config.config.supportInvidious) { + injectUpdatedScripts([ + utils.getExtraSiteRegistration() + ]) + } + }).catch(logWarn); } }); |