diff --git a/common/content/dactyl-overlay.js b/common/content/dactyl-overlay.js index 93b054b1..676a403d 100644 --- a/common/content/dactyl-overlay.js +++ b/common/content/dactyl-overlay.js @@ -18,7 +18,8 @@ __proto__: jsmodules, get content() window.content, jsmodules: jsmodules, - newContext: newContext + newContext: newContext, + window: window }; modules.modules = modules; diff --git a/common/content/dactyl.js b/common/content/dactyl.js index fe375905..d089724d 100644 --- a/common/content/dactyl.js +++ b/common/content/dactyl.js @@ -294,7 +294,7 @@ const Dactyl = Module("dactyl", { if (!context) context = userContext; - return Cu.evalInSandbox(str, context, "1.8", fileName, lineNumber); + return Cu.evalInSandbox("with (window) {" + str + "}", context, "1.8", fileName, lineNumber); }, /** @@ -1876,7 +1876,6 @@ const Dactyl = Module("dactyl", { }; }, load: function () { - jsmodules.__proto__ = window; dactyl.triggerObserver("load"); dactyl.log("All modules loaded", 3);