mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2025-01-03 18:42:00 +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", {});
|
scope = require.register("./extension", {});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const browserAvailable = typeof browser !== "undefined";
|
||||||
|
|
||||||
|
scope.inBackgroundScript = !!(
|
||||||
|
browserAvailable &&
|
||||||
|
browser.extension.getBackgroundPage &&
|
||||||
|
browser.extension.getBackgroundPage() === window
|
||||||
|
);
|
||||||
|
|
||||||
scope.getTranslation = function getTranslation(id){
|
scope.getTranslation = function getTranslation(id){
|
||||||
return browser.i18n.getMessage(id);
|
return browser.i18n.getMessage(id);
|
||||||
};
|
};
|
||||||
|
@ -400,7 +400,7 @@
|
|||||||
}
|
}
|
||||||
initialized = true;
|
initialized = true;
|
||||||
logging.message("settings loaded");
|
logging.message("settings loaded");
|
||||||
if (require.exists("./settingsMigration")){
|
if (require("./extension").inBackgroundScript){
|
||||||
const settingsMigration = require("./settingsMigration");
|
const settingsMigration = require("./settingsMigration");
|
||||||
settingsMigration.check(
|
settingsMigration.check(
|
||||||
storage,
|
storage,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user