diff --git a/common/content/autocommands.js b/common/content/autocommands.js old mode 100644 new mode 100755 index e2eef7f9..0adcaba0 --- a/common/content/autocommands.js +++ b/common/content/autocommands.js @@ -31,12 +31,14 @@ const AutoCommands = Module("autocommands", { * @param {string} cmd The Ex command to run. */ add: function (events, regex, cmd) { + let self = this; + if (typeof events == "string") { events = events.split(","); liberator.log("DEPRECATED: the events list arg to autocommands.add() should be an array of event names"); } events.forEach(function (event) { - this._store.push(new AutoCommand(event, RegExp(regex), cmd)); + self._store.push(new AutoCommand(event, RegExp(regex), cmd)); }); },