diff --git a/common/components/protocols.js b/common/components/protocols.js index adf0880c..a3c87ae5 100644 --- a/common/components/protocols.js +++ b/common/components/protocols.js @@ -89,11 +89,12 @@ function Dactyl() { this.HELP_TAGS = {}; this.FILE_MAP = {}; this.OVERLAY_MAP = {}; - this.addonID = this.name + "@dactyl.googlecode.com"; this.pages = {}; for each (let pref in ["appName", "fileExt", "host", "hostbin", "idName", "name"]) this[pref] = prefs.getComplexValue(pref, Ci.nsISupportsString).data; + + this.addonID = this.name + "@dactyl.googlecode.com"; } Dactyl.prototype = { contractID: "@mozilla.org/network/protocol;1?name=dactyl", diff --git a/common/content/dactyl.js b/common/content/dactyl.js index 01a9ae4d..0e4bb049 100644 --- a/common/content/dactyl.js +++ b/common/content/dactyl.js @@ -1096,17 +1096,16 @@ const Dactyl = Module("dactyl", { let save = ["forceNewTab", "forceNewWindow"]; let saved = save.map(function (p) dactyl[p]); return function wrappedCallback() { - let vals = save.map(function (p) dactyl[p]); - saved.forEach(function (p, i) dactyl[save[i]] = p); - try { - return callback.apply(self, arguments); - } - catch (e) { - dactyl.reportError(e, true); - } - finally { - vals.forEach(function (p, i) dactyl[save[i]] = p); - } + let args = arguments; + return dactyl.withSavedValues(save, function () { + saved.forEach(function (p, i) dactyl[save[i]] = p); + try { + return callback.apply(self, args); + } + catch (e) { + dactyl.reportError(e, true); + } + }); } }, @@ -1546,7 +1545,7 @@ const Dactyl = Module("dactyl", { else if (file.isReadable() && file.isFile()) AddonManager.getInstallForFile(file, install, "application/x-xpinstall"); else if (file.isDirectory()) - dactyl.echomsg("Cannot install a directory: " + file.path.quote(), 0); + dactyl.echoerr("Cannot install a directory: " + file.path.quote()); else dactyl.echoerr("E484: Can't open file " + file.path); }, {