From 473cb45ee767918058f72cf2d1b5d86771dddee3 Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Thu, 6 Apr 2023 16:54:59 +0000 Subject: [PATCH] autoconfig: add get_firefox_version function --- src/mobile-config-autoconfig.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/mobile-config-autoconfig.js b/src/mobile-config-autoconfig.js index 5fa49be..b59def7 100644 --- a/src/mobile-config-autoconfig.js +++ b/src/mobile-config-autoconfig.js @@ -44,6 +44,15 @@ function log_obj(obj) { } } +function get_firefox_version() { + try { + return Services.appinfo.lastAppVersion; + } catch(e) { + log("Failed to get FF version: " + e); + return 0; + } +} + function trigger_firefox_restart() { log("Triggering Firefox restart"); var appStartup = Cc["@mozilla.org/toolkit/app-startup;1"].getService(Ci.nsIAppStartup); @@ -74,6 +83,9 @@ function set_default_prefs() { log("Running mobile-config-autoconfig.js"); +var ff_version = get_firefox_version(); +log("Firefox version: " + ff_version); + // Create nsIFile objects for userChrome.css in /chrome/ and in /etc/ var chromeFile = chromeDir.clone(); chromeFile.append("userChrome.css");