From 23bbb5a1e52c8c1e1b448839ee61ad8b29ae22af Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Mon, 5 Mar 2018 17:37:24 -0500 Subject: [PATCH] Make atob() available in translator sandbox Addresses zotero/translators#1576 --- .../zotero/xpcom/translation/translate_firefox.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/translation/translate_firefox.js b/chrome/content/zotero/xpcom/translation/translate_firefox.js index 7e282ecbbb..2e66d5f9db 100644 --- a/chrome/content/zotero/xpcom/translation/translate_firefox.js +++ b/chrome/content/zotero/xpcom/translation/translate_firefox.js @@ -368,7 +368,16 @@ Zotero.Translate.DOMWrapper = new function() { */ Zotero.Translate.SandboxManager = function(sandboxLocation) { // sandboxLocation = Components.classes["@mozilla.org/systemprincipal;1"].createInstance(Components.interfaces.nsIPrincipal); - var sandbox = this.sandbox = new Components.utils.Sandbox(sandboxLocation, {wantComponents:false, wantGlobalProperties:["XMLHttpRequest"]}); + var sandbox = this.sandbox = new Components.utils.Sandbox( + sandboxLocation, + { + wantComponents: false, + wantGlobalProperties: [ + 'atob', + 'XMLHttpRequest' + ] + } + ); this.sandbox.Zotero = {}; // import functions missing from global scope into Fx sandbox