CookieSandbox: Fix attachToInterfaceRequestor() for XHRs (#4043)

This commit is contained in:
Abe Jellinek 2024-04-23 18:53:46 -04:00 committed by GitHub
parent 0077c3f07a
commit 12b6645a1f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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);
}
}
}
}