From 093365f75355400a0ba8f390e7cece7e0c4090f7 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Wed, 20 Oct 2010 02:31:35 -0400 Subject: [PATCH] Fix FF36 colossally broken by last commit. --- common/content/dactyl.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/common/content/dactyl.js b/common/content/dactyl.js index 10b89614..e5109ce3 100644 --- a/common/content/dactyl.js +++ b/common/content/dactyl.js @@ -297,7 +297,9 @@ const Dactyl = Module("dactyl", { if (!context) context = userContext; - return Cu.evalInSandbox(str, context, "1.8", fileName, lineNumber); + if (!window.XPCSafeJSObjectWrapper) + return Cu.evalInSandbox(str, context, "1.8", fileName, lineNumber); + return Cu.evalInSandbox("with (window) { with (modules) { this.eval(" + str.quote() + ") } }", context, "1.8", fileName, lineNumber); }, /** @@ -1989,7 +1991,8 @@ const Dactyl = Module("dactyl", { let init = services.get("environment").get(config.idName + "_INIT"); let rcFile = io.getRCFile("~"); - jsmodules.__proto__ = (window.XPCSafeJSObjectWrapper || XPCNativeWrapper)(window); + if (!window.XPCSafeJSObjectWrapper) + jsmodules.__proto__ = XPCNativeWrapper(window); try { if (dactyl.commandLineOptions.rcFile) {