diff --git a/config/default.json b/config/default.json index b99b213..ce2c3ce 100644 --- a/config/default.json +++ b/config/default.json @@ -8,5 +8,6 @@ "CrossrefREST.email": "" // Pass an email to Crossref REST API to utilize the faster servers pool }, "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:61.0) Gecko/20100101 Firefox/61.0", - "translatorsDirectory": "./modules/translators" + "translatorsDirectory": "./modules/translators", + "persistentCookies": false // Remember upstream cookies between translation operations. Do not enable for a public service. } diff --git a/src/http.js b/src/http.js index f9fd3b4..9653bbc 100644 --- a/src/http.js +++ b/src/http.js @@ -91,6 +91,10 @@ Zotero.HTTP = new function() { maxResponseSize: 50 * 1024 * 1024 }, options); + if (config.get('persistentCookies')) { + options.cookieSandbox = true; + } + options.headers = Object.assign({ 'User-Agent': config.get('userAgent') }, options.headers);