1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-27 15:32:27 +01:00

Fix useragent.js bug.

This commit is contained in:
Kris Maglione
2011-12-01 14:29:53 -05:00
parent 81271ab4ef
commit e9b287c83c
2 changed files with 10 additions and 2 deletions

View File

@@ -1483,7 +1483,7 @@ var Commands = Module("commands", {
let start = "«%-d-]'", end = "'[-d-%»";
let n = /^\d+$/.test(cmd.argCount) ? parseInt(argCount) : 12;
let n = /^\d+$/.test(cmd.argCount) ? parseInt(cmd.argCount) : 12;
for (let i = args.completeArg; i < n; i++)
args[i] = start + i + end;

View File

@@ -199,10 +199,18 @@ var Prefs = Module("prefs", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference])
*/
getNames: function getNames(branch) this.branch.getChildList(branch || "", { value: 0 }),
/**
* Returns true if the current branch has the given preference.
*
* @param {string} name The preference name.
* @returns {boolean}
*/
has: function get(name) this.branch.getPrefType(name) != 0,
_checkSafe: function _checkSafe(name, message, value) {
let curval = this.get(name, null);
if (this.branches.original.get(name) == null)
if (this.branches.original.get(name) == null && !this.branches.saved.has(name))
this.branches.original.set(name, curval, true);
if (arguments.length > 2 && curval === value)