From 64c317d8620098a29830f774190de3deb7e33d3d Mon Sep 17 00:00:00 2001 From: hackademix Date: Tue, 12 Nov 2024 08:52:42 +0100 Subject: [PATCH] Import versioning module just once. --- src/bg/LifeCycle.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/bg/LifeCycle.js b/src/bg/LifeCycle.js index 7b367ff..38aca62 100644 --- a/src/bg/LifeCycle.js +++ b/src/bg/LifeCycle.js @@ -236,6 +236,9 @@ var LifeCycle = (() => { } } + + const versioning = include("/nscl/common/Ver.js"); + return { async onInstalled(details) { if (!UA.isMozilla) { @@ -279,7 +282,7 @@ var LifeCycle = (() => { if (!previousVersion) return; - await include("/nscl/common/Ver.js"); + await versioning; previousVersion = new Ver(previousVersion); let currentVersion = new Ver(browser.runtime.getManifest().version); let upgrading = Ver.is(previousVersion, "<=", currentVersion); @@ -364,7 +367,7 @@ var LifeCycle = (() => { // user doesn't want us to remember temporary settings across updates: bail out return; } - await include("/nscl/common/Ver.js"); + await versioning; if (Ver.is(details.version, "<", browser.runtime.getManifest().version)) { // downgrade: temporary survival might not be supported, and we don't care return;