From c65170e254c9927be9b727223e3838ae5a5a8f7a Mon Sep 17 00:00:00 2001 From: iw0 Date: Fri, 3 May 2024 23:23:33 +0200 Subject: [PATCH] less annoyance on bug fix releases --- bg.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/bg.js b/bg.js index fed710c..4a82545 100644 --- a/bg.js +++ b/bg.js @@ -1,7 +1,10 @@ browser.runtime.onInstalled.addListener((ev) => { if (ev.reason == "update") { - launchInfoPage(); - // TODO determine how to launch the page only when there are important changes + updateIsSignificant(ev.previousVersion).then( + v => { + if (v) launchInfoPage(); + } + ) } else if (ev.reason == "install") { browser.runtime.openOptionsPage() } @@ -10,7 +13,7 @@ browser.runtime.onInstalled.addListener((ev) => { async function updateIsSignificant(previousVersion) { const significantUpdates = ["0.1.0", "0.2.0", "0.3.0"]; let currentVersion = (await browser.management.getSelf()).version; - return currentVersion in significantUpdates; + return (currentVersion in significantUpdates) || currentVersion.endsWith('0'); } function launchInfoPage(){ browser.tabs.create({url: "/changelog.htm", active: false})