Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Minor tweaks in GM_ScriptStorage

  • Loading branch information...
commit edc1cdd0d44a27ea44222a9bfc016e6b06f96648 1 parent 22fbde1
@supahgreg supahgreg authored
Showing with 6 additions and 6 deletions.
  1. +6 −6 extension/modules/api/GM_ScriptStorage.js
View
12 extension/modules/api/GM_ScriptStorage.js
@@ -53,9 +53,9 @@ GM_ScriptStorage.prototype._prefChanged = function(aName) {
oldValue: "r",
newValue: "r"
},
- "name": aName,
- "oldValue": this._watchedPrefs[aName].currentValue,
- "newValue": newValue
+ name: aName,
+ oldValue: this._watchedPrefs[aName].currentValue,
+ newValue: newValue
});
}
this._watchedPrefs[aName].currentValue = newValue;
@@ -82,8 +82,8 @@ GM_ScriptStorage.prototype.watchValue = function(aName, aListener) {
}
else {
this._watchedPrefs[aName] = {
- "currentValue": this.getValue(aName),
- "watchers": [watcher]
+ currentValue: this.getValue(aName),
+ watchers: [watcher]
};
// Start watching the pref
@@ -103,7 +103,7 @@ GM_ScriptStorage.prototype.unwatchValue = function(aName, aUUID) {
let watchers = this._watchedPrefs[aName].watchers;
// If given a UUID, only remove the specified watcher
- if (aUUID) {
+ if ("string" === typeof aUUID) {
for (let i = 0, e = watchers.length; i < e; ++i) {
if (aUUID === watchers[i].uuid) {
watchers.splice(i, 1);
Please sign in to comment.
Something went wrong with that request. Please try again.