From cc4a4a791bb2969bcb301b190078d4c95d4e9a00 Mon Sep 17 00:00:00 2001 From: Ulrik de Muelenaere Date: Mon, 3 Jul 2023 15:49:49 +0200 Subject: [PATCH] autoconfig: Fix version detection on first start (MR 32) Previously the Firefox version would be detected as 0 on the first start, causing popups.before-ff-108.css to be included even on newer versions, which breaks touch input. --- src/mobile-config-autoconfig.js | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/mobile-config-autoconfig.js b/src/mobile-config-autoconfig.js index 5d9691d..3b0fce9 100644 --- a/src/mobile-config-autoconfig.js +++ b/src/mobile-config-autoconfig.js @@ -71,12 +71,7 @@ function log_obj(obj) { } function get_firefox_version() { - try { - return Services.appinfo.lastAppVersion.split(".")[0]; - } catch(e) { - log("Couldn't get Firefox version (expected on first start): " + e); - return 0; - } + return Services.appinfo.version.split(".")[0]; } function get_firefox_version_previous() { @@ -250,10 +245,7 @@ function css_files_update() { var file = css_file_get(name); if (file.exists()) { - /* During the very first start, ff_previous is first "unknown", - * then the files get installed and Firefox gets restarted. - * Then ff_previous is 0. Don't restart it again. */ - if (ff_previous != 0 && g_ff_version != ff_previous) { + if (g_ff_version != ff_previous) { log("Removing outdated file: " + file.path + " (Firefox" + " version changed)"); file.remove(false);