1
0
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:
kkapsner 2019-04-19 14:09:56 +02:00
parent b7a8a51a56
commit 505fb6409e
2 changed files with 9 additions and 1 deletions

View File

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

View File

@ -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,