diff --git a/chrome/content/zotero/xpcom/translation/translate.js b/chrome/content/zotero/xpcom/translation/translate.js index 7a5ada378..268870191 100644 --- a/chrome/content/zotero/xpcom/translation/translate.js +++ b/chrome/content/zotero/xpcom/translation/translate.js @@ -1157,7 +1157,7 @@ Zotero.Translate.Base.prototype = { */ "_loadTranslator":function(translator, callback) { var sandboxLocation = this._getSandboxLocation(); - if(!this._sandboxLocation || sandboxLocation != this._sandboxLocation) { + if(!this._sandboxLocation || sandboxLocation !== this._sandboxLocation) { this._sandboxLocation = sandboxLocation; this._generateSandbox(); } diff --git a/chrome/content/zotero/xpcom/translation/translate_firefox.js b/chrome/content/zotero/xpcom/translation/translate_firefox.js index a7892ca62..61d583ba9 100644 --- a/chrome/content/zotero/xpcom/translation/translate_firefox.js +++ b/chrome/content/zotero/xpcom/translation/translate_firefox.js @@ -129,7 +129,11 @@ Zotero.Translate.SandboxManager.prototype = { * Evaluates code in the sandbox */ "eval":function(code, exported, path) { - Components.utils.evalInSandbox(code, this.sandbox, "1.8", path, 1); + if(Zotero.isFx4) { + Components.utils.evalInSandbox(code, this.sandbox, "1.8", path, 1); + } else { + Components.utils.evalInSandbox(code, this.sandbox); + } }, /** @@ -147,7 +151,6 @@ Zotero.Translate.SandboxManager.prototype = { let localKey = key; if(newExposedProps) newExposedProps[localKey] = "r"; - // magical XPCSafeJSObjectWrappers for sandbox var type = typeof object[localKey]; var isFunction = type === "function"; var isObject = typeof object[localKey] === "object"; @@ -171,9 +174,7 @@ Zotero.Translate.SandboxManager.prototype = { } for(var i=0, nArgs=arguments.length; i= 2) { // evaluate Components.utils.evalInSandbox(prefsJs, sandbox); - var prefs = new XPCSafeJSObjectWrapper(sandbox.prefs); + if(Zotero.isFx4) { + var prefs = sandbox.prefs; + } else { + var prefs = new XPCSafeJSObjectWrapper(sandbox.prefs); + } for(var key in prefs) { if(key.substr(0, ZOTERO_CONFIG.PREF_BRANCH.length) === ZOTERO_CONFIG.PREF_BRANCH && key !== "extensions.zotero.firstRun2") {