From 5620dc96bd21a49a82277869b9e09ff68c842e68 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sun, 10 Jul 2022 06:26:07 -0400 Subject: [PATCH] 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 --- chrome/content/zotero/xpcom/cookieSandbox.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/xpcom/cookieSandbox.js b/chrome/content/zotero/xpcom/cookieSandbox.js index 6df16c02fc..c23233d7fd 100755 --- a/chrome/content/zotero/xpcom/cookieSandbox.js +++ b/chrome/content/zotero/xpcom/cookieSandbox.js @@ -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);