diff --git a/chrome/content/zotero/xpcom/cookieSandbox.js b/chrome/content/zotero/xpcom/cookieSandbox.js index e17a7423f..20d0f7e89 100755 --- a/chrome/content/zotero/xpcom/cookieSandbox.js +++ b/chrome/content/zotero/xpcom/cookieSandbox.js @@ -102,7 +102,8 @@ Zotero.CookieSandbox.prototype = { * @param {nsIInterfaceRequestor} ir */ "attachToInterfaceRequestor": function(ir) { - Zotero.CookieSandbox.Observer.trackedInterfaceRequestors.set(ir.QueryInterface(Components.interfaces.nsIInterfaceRequestor), this); + Zotero.CookieSandbox.Observer.trackedInterfaceRequestors.push(Components.utils.getWeakReference(ir.QueryInterface(Components.interfaces.nsIInterfaceRequestor))); + Zotero.CookieSandbox.Observer.trackedInterfaceRequestorSandboxes.push(this); } } @@ -125,7 +126,8 @@ Zotero.CookieSandbox.Observer = new function() { */ this.register = function(CookieSandbox) { this.trackedBrowsers = new WeakMap(); - this.trackedInterfaceRequestors = new WeakMap(); + this.trackedInterfaceRequestors = []; + this.trackedInterfaceRequestorSandboxes = []; if(!observing) { Zotero.debug("CookieSandbox: Registering observers"); @@ -145,8 +147,22 @@ Zotero.CookieSandbox.Observer = new function() { // try the notification callbacks if(notificationCallbacks) { - trackedBy = this.trackedInterfaceRequestors.get(notificationCallbacks); - if(trackedBy) { + for(var i=0; i