aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/background.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/background.ts')
-rw-r--r--src/background.ts13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/background.ts b/src/background.ts
index e14f8e48..a5a70219 100644
--- a/src/background.ts
+++ b/src/background.ts
@@ -9,7 +9,7 @@ import { generateUserID } from "../maze-utils/src/setup";
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";
@@ -138,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);
}
});