Support invidious in mv3

This commit is contained in:
Ajay
2024-06-19 23:14:27 +05:30
parent a95020dda3
commit 98a4a076bc
7 changed files with 36 additions and 39 deletions

View File

@@ -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);
}
});