Add support for live updating in chrome

This commit is contained in:
Ajay
2023-07-29 01:41:57 -04:00
parent 90bb9a4d02
commit dc91ee76ca
7 changed files with 87 additions and 24 deletions

View File

@@ -13,6 +13,9 @@ window.SB = Config;
import Utils from "./utils";
import { getExtensionIdsToImportFrom } from "./utils/crossExtension";
import { isFirefoxOrSafari } from "./maze-utils";
import { injectUpdatedScripts } from "./maze-utils/cleanup";
import { logWarn } from "./utils/logger";
const utils = new Utils({
registerFirefoxContentScript,
unregisterFirefoxContentScript
@@ -132,6 +135,11 @@ 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") {
injectUpdatedScripts().catch(logWarn);
}
});
/**