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.
This commit is contained in:
parent
3959e7c476
commit
cc4a4a791b
1 changed files with 2 additions and 10 deletions
|
@ -71,12 +71,7 @@ function log_obj(obj) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_firefox_version() {
|
function get_firefox_version() {
|
||||||
try {
|
return Services.appinfo.version.split(".")[0];
|
||||||
return Services.appinfo.lastAppVersion.split(".")[0];
|
|
||||||
} catch(e) {
|
|
||||||
log("Couldn't get Firefox version (expected on first start): " + e);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_firefox_version_previous() {
|
function get_firefox_version_previous() {
|
||||||
|
@ -250,10 +245,7 @@ function css_files_update() {
|
||||||
var file = css_file_get(name);
|
var file = css_file_get(name);
|
||||||
|
|
||||||
if (file.exists()) {
|
if (file.exists()) {
|
||||||
/* During the very first start, ff_previous is first "unknown",
|
if (g_ff_version != ff_previous) {
|
||||||
* 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) {
|
|
||||||
log("Removing outdated file: " + file.path + " (Firefox" +
|
log("Removing outdated file: " + file.path + " (Firefox" +
|
||||||
" version changed)");
|
" version changed)");
|
||||||
file.remove(false);
|
file.remove(false);
|
||||||
|
|
Loading…
Reference in a new issue