diff --git a/common/content/dactyl.js b/common/content/dactyl.js index 6321fa3b..dc9df88b 100644 --- a/common/content/dactyl.js +++ b/common/content/dactyl.js @@ -1859,6 +1859,9 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { dactyl.log(_("dactyl.modulesLoaded"), 3); + userContext.DOM = Class("DOM", DOM, { init: function DOM_(sel, ctxt) DOM(sel, ctxt || buffer.focusedFrame.document) }); + userContext.$ = modules.userContext.DOM; + dactyl.timeout(function () { try { var args = config.prefs.get("commandline-args") diff --git a/common/modules/downloads.jsm b/common/modules/downloads.jsm index e2ece139..38172105 100644 --- a/common/modules/downloads.jsm +++ b/common/modules/downloads.jsm @@ -19,9 +19,8 @@ var states = iter([v, k.slice(prefix.length).toLowerCase()] var Download = Class("Download", { init: function init(id, list) { - let self = XPCSafeJSObjectWrapper(services.downloadManager.getDownload(id)); - self.__proto__ = this; - this.instance = this; + let self = this; + this.download = services.downloadManager.getDownload(id); this.list = list; this.nodes = { @@ -192,6 +191,14 @@ var Download = Class("Download", { this.updateProgress(); } }); +Object.keys(XPCOMShim([Ci.nsIDownload])).forEach(function (key) { + if (!(key in Download.prototype)) + Object.defineProperty(Download.prototype, key, { + get: function get() this.download[key], + set: function set(val) this.download[key] = val, + configurable: true + }); +}); var DownloadList = Class("DownloadList", XPCOM([Ci.nsIDownloadProgressListener,