1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-20 01:57:58 +01:00

Resume loading modules from a different URI each run, flush cache just to be safe.

This commit is contained in:
Kris Maglione
2011-04-29 14:51:22 -04:00
parent 7115948106
commit dbb097ab7d

11
common/bootstrap.js vendored
View File

@@ -155,7 +155,6 @@ function init() {
let chars = "0123456789abcdefghijklmnopqrstuv"; let chars = "0123456789abcdefghijklmnopqrstuv";
for (let n = Date.now(); n; n = Math.round(n / chars.length)) for (let n = Date.now(); n; n = Math.round(n / chars.length))
suffix += chars[n % chars.length]; suffix += chars[n % chars.length];
suffix = "";
for each (let line in manifest.split("\n")) { for each (let line in manifest.split("\n")) {
let fields = line.split(/\s+/); let fields = line.split(/\s+/);
@@ -172,12 +171,22 @@ function init() {
break; break;
case "resource": case "resource":
var hardSuffix = /^[^\/]*/.exec(fields[2])[0];
resources.push(fields[1], fields[1] + suffix); resources.push(fields[1], fields[1] + suffix);
resourceProto.setSubstitution(fields[1], getURI(fields[2])); resourceProto.setSubstitution(fields[1], getURI(fields[2]));
resourceProto.setSubstitution(fields[1] + suffix, getURI(fields[2])); resourceProto.setSubstitution(fields[1] + suffix, getURI(fields[2]));
} }
} }
// Flush the cache if necessary, just to be paranoid
let pref = "extensions.dactyl.cacheFlushCheck";
let val = addon.version + "-" + hardSuffix;
if (!Services.prefs.prefHasUserValue(pref) || Services.prefs.getCharPref(pref) != val) {
Services.obs.notifyObservers(null, "startupcache-invalidate", "");
Services.prefs.setCharPref(pref, val);
}
try { try {
module("resource://dactyl-content/disable-acr.jsm").init(addon.id); module("resource://dactyl-content/disable-acr.jsm").init(addon.id);
} }