From 12b6645a1feff2e3f829d62a9b86c2ef048e31f6 Mon Sep 17 00:00:00 2001 From: Abe Jellinek Date: Tue, 23 Apr 2024 18:53:46 -0400 Subject: [PATCH] CookieSandbox: Fix attachToInterfaceRequestor() for XHRs (#4043) --- chrome/content/zotero/xpcom/cookieSandbox.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/xpcom/cookieSandbox.js b/chrome/content/zotero/xpcom/cookieSandbox.js index be3906978f..0b8da0efbf 100755 --- a/chrome/content/zotero/xpcom/cookieSandbox.js +++ b/chrome/content/zotero/xpcom/cookieSandbox.js @@ -170,7 +170,10 @@ Zotero.CookieSandbox.prototype = { * @param {nsIInterfaceRequestor} ir */ "attachToInterfaceRequestor": function(ir) { - Zotero.CookieSandbox.Observer.trackedInterfaceRequestors.set(ir.QueryInterface(Components.interfaces.nsIInterfaceRequestor), this); + if (typeof ir.QueryInterface === 'function') { + ir = ir.QueryInterface(Components.interfaces.nsIInterfaceRequestor); + } + Zotero.CookieSandbox.Observer.trackedInterfaceRequestors.set(ir, this); }, /** @@ -413,4 +416,4 @@ Zotero.CookieSandbox.Observer = new function() { Zotero.debug("CookieSandbox: Slurped cookies from "+channelURI, 5); } } -} \ No newline at end of file +}