diff options
-rw-r--r-- | common/content/events.js | 5 | ||||
-rw-r--r-- | common/modules/contexts.jsm | 4 | ||||
-rw-r--r-- | common/modules/options.jsm | 4 | ||||
-rw-r--r-- | common/modules/styles.jsm | 16 |
4 files changed, 21 insertions, 8 deletions
diff --git a/common/content/events.js b/common/content/events.js index 139611b5..d3812035 100644 --- a/common/content/events.js +++ b/common/content/events.js @@ -1586,7 +1586,10 @@ var Events = Module("events", { mappings.add([modes.MAIN], ["<C-z>", "<pass-all-keys>"], "Temporarily ignore all " + config.appName + " key bindings", - function () { modes.push(modes.PASS_THROUGH); }); + function () { + if (modes.main != modes.PASS_THROUGH) + modes.push(modes.PASS_THROUGH); + }); mappings.add([modes.MAIN, modes.PASS_THROUGH, modes.QUOTE], ["<C-v>", "<pass-next-key>"], "Pass through next key", diff --git a/common/modules/contexts.jsm b/common/modules/contexts.jsm index b6c68ecc..b41bb9fc 100644 --- a/common/modules/contexts.jsm +++ b/common/modules/contexts.jsm @@ -47,7 +47,7 @@ var Group = Class("Group", { makeArgs: function makeArgs(doc, context, args) { let res = update({ doc: doc, context: context }, args); - return update(this.argsExtra(res), args); + return update(res, this.argsExtra(res), args); }, get toStringParams() [this.name], @@ -194,7 +194,7 @@ var Contexts = Module("contexts", { let contextPath = file.path; let self = Set.has(plugins, contextPath) && plugins.contexts[contextPath]; - if (!self && isPlugin) + if (!self && isPlugin && false) self = Set.has(plugins, id) && plugins[id]; if (self) { diff --git a/common/modules/options.jsm b/common/modules/options.jsm index 828fd0ce..54b500df 100644 --- a/common/modules/options.jsm +++ b/common/modules/options.jsm @@ -798,8 +798,8 @@ var Options = Module("options", { util.makeDTD( iter(([["option", o.name, "default"].join("."), o.type === "string" ? o.defaultValue.replace(/'/g, "''") : - o.value === true ? "on" : - o.value === false ? "off" : o.stringDefaultValue] + o.defaultValue === true ? "on" : + o.defaultValue === false ? "off" : o.stringDefaultValue] for (o in self)), ([["option", o.name, "type"].join("."), o.type] for (o in self)), diff --git a/common/modules/styles.jsm b/common/modules/styles.jsm index d164c92e..3f5b28a8 100644 --- a/common/modules/styles.jsm +++ b/common/modules/styles.jsm @@ -74,11 +74,11 @@ update(Sheet.prototype, { return preamble + css; let selectors = filter.map(function (part) - !/^(?:[a-z-]+[:*]|[a-z-.]+$)/i.test(part) ? "regexp(" + (".*(?:" + part + ").*").quote() + ")" : + !/^(?:[a-z-]+[:*]|[a-z-.]+$)/i.test(part) ? "regexp(" + Styles.quote(".*(?:" + part + ").*") + ")" : (/[*]$/.test(part) ? "url-prefix" : /[\/:]/.test(part) ? "url" : "domain") - + '("' + part.replace(/"/g, "%22").replace(/\*$/, "") + '")') + + '(' + Styles.quote(part.replace(/\*$/, "")) + ')') .join(",\n "); return preamble + "@-moz-document " + selectors + " {\n\n" + css + "\n\n}\n"; @@ -530,7 +530,17 @@ var Styles = Module("Styles", { | [^;}\s]+ ) ]]>, "gix", this) - }) + }), + + /** + * Quotes a string for use in CSS stylesheets. + * + * @param {string} str + * @returns {string} + */ + quote: function quote(str) { + return '"' + str.replace(/([\\"])/g, "\\$1").replace(/\n/g, "\\00000a") + '"'; + }, }, { commands: function (dactyl, modules, window) { const { commands, contexts, styles } = modules; |