Improve cookie-sandbox behavior when getting attachments via WBP
Previously cookies only got attached on the initial request but not on any redirect and subsequent request. This may have been the cause for many reports of import failures behind proxies in the past.
This commit is contained in:
parent
02098a9a34
commit
0aae101196
1 changed files with 11 additions and 10 deletions
|
@ -317,10 +317,17 @@ Zotero.CookieSandbox.Observer = new function() {
|
||||||
this.trackedInterfaceRequestors.splice(i, 1);
|
this.trackedInterfaceRequestors.splice(i, 1);
|
||||||
this.trackedInterfaceRequestorSandboxes.splice(i, 1);
|
this.trackedInterfaceRequestorSandboxes.splice(i, 1);
|
||||||
i--;
|
i--;
|
||||||
} else if(ir == notificationCallbacks) {
|
} else {
|
||||||
// We are tracking this interface requestor
|
let tracked = ir === notificationCallbacks;
|
||||||
trackedBy = this.trackedInterfaceRequestorSandboxes[i];
|
try {
|
||||||
break;
|
tracked = ir === notificationCallbacks.getInterface(Ci.nsIWebBrowserPersist);
|
||||||
|
} catch (e) { }
|
||||||
|
|
||||||
|
if (tracked) {
|
||||||
|
// We are tracking this interface requestor
|
||||||
|
trackedBy = this.trackedInterfaceRequestorSandboxes[i];
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -350,12 +357,6 @@ Zotero.CookieSandbox.Observer = new function() {
|
||||||
notificationCallbacks.QueryInterface(Components.interfaces.nsIXMLHttpRequest);
|
notificationCallbacks.QueryInterface(Components.interfaces.nsIXMLHttpRequest);
|
||||||
tested = true;
|
tested = true;
|
||||||
} catch(e) {}
|
} catch(e) {}
|
||||||
if(!tested) {
|
|
||||||
try {
|
|
||||||
notificationCallbacks.QueryInterface(Components.interfaces.nsIWebBrowserPersist);
|
|
||||||
tested = true;
|
|
||||||
} catch(e) {}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue