From 301a8e53779f08274ee46355316982a499d85fe8 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Thu, 7 Oct 2010 23:35:53 -0400 Subject: [PATCH] Just use with (window) in userEval. Adding it to the prototype chain causes too much trouble. --HG-- branch : mode-refactoring --- common/content/dactyl-overlay.js | 3 ++- common/content/dactyl.js | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) 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);