Make atob() available in translator sandbox

Addresses zotero/translators#1576
This commit is contained in:
Dan Stillman 2018-03-05 17:37:24 -05:00
parent 87efe75e24
commit 23bbb5a1e5

View file

@ -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