mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2024-12-22 12:50:36 +01:00
Run setting migration only in background script
This commit is contained in:
parent
b7a8a51a56
commit
505fb6409e
@ -12,6 +12,14 @@
|
||||
scope = require.register("./extension", {});
|
||||
}
|
||||
|
||||
const browserAvailable = typeof browser !== "undefined";
|
||||
|
||||
scope.inBackgroundScript = !!(
|
||||
browserAvailable &&
|
||||
browser.extension.getBackgroundPage &&
|
||||
browser.extension.getBackgroundPage() === window
|
||||
);
|
||||
|
||||
scope.getTranslation = function getTranslation(id){
|
||||
return browser.i18n.getMessage(id);
|
||||
};
|
||||
|
@ -400,7 +400,7 @@
|
||||
}
|
||||
initialized = true;
|
||||
logging.message("settings loaded");
|
||||
if (require.exists("./settingsMigration")){
|
||||
if (require("./extension").inBackgroundScript){
|
||||
const settingsMigration = require("./settingsMigration");
|
||||
settingsMigration.check(
|
||||
storage,
|
||||
|
Loading…
x
Reference in New Issue
Block a user