autoconfig: add get_firefox_version function

This commit is contained in:
Oliver Smith 2023-04-06 16:54:59 +00:00
parent a9dbfcd48b
commit 473cb45ee7
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB

View file

@ -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() { function trigger_firefox_restart() {
log("Triggering Firefox restart"); log("Triggering Firefox restart");
var appStartup = Cc["@mozilla.org/toolkit/app-startup;1"].getService(Ci.nsIAppStartup); 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"); log("Running mobile-config-autoconfig.js");
var ff_version = get_firefox_version();
log("Firefox version: " + ff_version);
// Create nsIFile objects for userChrome.css in <profile>/chrome/ and in /etc/ // Create nsIFile objects for userChrome.css in <profile>/chrome/ and in /etc/
var chromeFile = chromeDir.clone(); var chromeFile = chromeDir.clone();
chromeFile.append("userChrome.css"); chromeFile.append("userChrome.css");