mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-01-10 18:14:12 +01:00
Add +purgecaches startup flag. Process startup flags in :restart. Don't purge caches on :rehash.
This commit is contained in:
@@ -17,6 +17,7 @@ this.lazyRequire("addons", ["AddonManager"]);
|
||||
this.lazyRequire("cache", ["cache"]);
|
||||
this.lazyRequire("highlight", ["highlight"]);
|
||||
this.lazyRequire("messages", ["_"]);
|
||||
this.lazyRequire("prefs", ["localPrefs", "prefs"]);
|
||||
|
||||
function AboutHandler() {}
|
||||
AboutHandler.prototype = {
|
||||
@@ -66,6 +67,8 @@ var ConfigBase = Class("ConfigBase", {
|
||||
});
|
||||
},
|
||||
|
||||
get prefs() localPrefs,
|
||||
|
||||
get has() Set.has(this.features),
|
||||
|
||||
configFiles: [
|
||||
|
||||
@@ -57,7 +57,7 @@ var HelpBuilder = Class("HelpBuilder", {
|
||||
let result = [];
|
||||
for (let base in values(this.bases)) {
|
||||
let url = [base, file, ".xml"].join("");
|
||||
let res = util.httpGet(url);
|
||||
let res = util.httpGet(url, { quiet: true });
|
||||
if (res) {
|
||||
if (res.responseXML.documentElement.localName == "document")
|
||||
this.files[file] = url;
|
||||
|
||||
@@ -14,6 +14,8 @@ defineModule("options", {
|
||||
require: ["contexts", "messages", "storage"]
|
||||
}, this);
|
||||
|
||||
this.lazyRequire("config", ["config"]);
|
||||
|
||||
/** @scope modules */
|
||||
|
||||
let ValueError = Class("ValueError", ErrorBase);
|
||||
@@ -947,7 +949,7 @@ var Options = Module("options", {
|
||||
setPref: deprecated("prefs.set", function setPref() prefs.set.apply(prefs, arguments)),
|
||||
withContext: deprecated("prefs.withContext", function withContext() prefs.withContext.apply(prefs, arguments)),
|
||||
|
||||
cleanupPrefs: Class.Memoize(function () localPrefs.Branch("cleanup.option.")),
|
||||
cleanupPrefs: Class.Memoize(function () config.prefs.Branch("cleanup.option.")),
|
||||
|
||||
cleanup: function cleanup(reason) {
|
||||
if (~["disable", "uninstall"].indexOf(reason))
|
||||
|
||||
@@ -55,7 +55,7 @@ var Item = Class("SanitizeItem", {
|
||||
shouldSanitize: function (shutdown) (!shutdown || this.builtin || this.persistent) &&
|
||||
prefs.get(shutdown ? this.shutdownPref : this.pref)
|
||||
}, {
|
||||
PREFIX: localPrefs.branch.root,
|
||||
PREFIX: config.prefs.branch.root,
|
||||
BRANCH: "privacy.cpd.",
|
||||
SHUTDOWN_BRANCH: "privacy.clearOnShutdown."
|
||||
});
|
||||
@@ -290,8 +290,8 @@ var Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakRef
|
||||
}
|
||||
},
|
||||
|
||||
get ranAtShutdown() localPrefs.get("didSanitizeOnShutdown"),
|
||||
set ranAtShutdown(val) localPrefs.set("didSanitizeOnShutdown", Boolean(val)),
|
||||
get ranAtShutdown() config.prefs.get("didSanitizeOnShutdown"),
|
||||
set ranAtShutdown(val) config.prefs.set("didSanitizeOnShutdown", Boolean(val)),
|
||||
get runAtShutdown() prefs.get("privacy.sanitize.sanitizeOnShutdown"),
|
||||
set runAtShutdown(val) prefs.set("privacy.sanitize.sanitizeOnShutdown", Boolean(val)),
|
||||
|
||||
|
||||
@@ -739,7 +739,8 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
|
||||
return xmlhttp;
|
||||
}
|
||||
catch (e) {
|
||||
util.dactyl.log(_("error.cantOpen", String.quote(url), e), 1);
|
||||
if (!params.quiet)
|
||||
util.dactyl.log(_("error.cantOpen", String.quote(url), e), 1);
|
||||
return null;
|
||||
}
|
||||
},
|
||||
@@ -1183,7 +1184,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
|
||||
rehash: function (args) {
|
||||
storage.session.commandlineArgs = args;
|
||||
this.timeout(function () {
|
||||
cache.flushAll();
|
||||
this.flushCache();
|
||||
this.rehashing = true;
|
||||
let addon = config.addon;
|
||||
addon.userDisabled = true;
|
||||
|
||||
Reference in New Issue
Block a user