CookieSandbox: Fix error setting request cookies

Regression from 6af3b0276a, showing up as "trackedBy is undefined" error

https://forums.zotero.org/discussion/98322/no-snapshot-or-pdf-autosaved-using-zotero-connector-on-safari
This commit is contained in:
Dan Stillman 2022-07-10 06:26:07 -04:00
parent 74f00e60c7
commit 5620dc96bd

View file

@ -384,10 +384,10 @@ Zotero.CookieSandbox.Observer = new function() {
var cookiesForURI = trackedBy.getCookiesForURI(channel.URI);
}
if(trackedBy.userAgent) {
if (trackedBy && trackedBy.userAgent) {
channel.setRequestHeader("User-Agent", trackedBy.userAgent, false);
}
if(!trackedBy || !cookiesForURI) {
channel.setRequestHeader("Cookie", "", false);
channel.setRequestHeader("Cookie2", "", false);