Remove antique code
This commit is contained in:
parent
08c8c4dfbd
commit
961b4b17d4
|
@ -32,35 +32,17 @@ Zotero.HTTP = new function() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Workaround for "Accept third-party cookies" being off in Firefox 3.0.1
|
|
||||||
// https://www.zotero.org/trac/ticket/1070
|
|
||||||
if (Zotero.isFx30) {
|
|
||||||
const Cc = Components.classes;
|
|
||||||
const Ci = Components.interfaces;
|
|
||||||
var ds = Cc["@mozilla.org/webshell;1"].
|
|
||||||
createInstance(Components.interfaces.nsIDocShellTreeItem).
|
|
||||||
QueryInterface(Ci.nsIInterfaceRequestor);
|
|
||||||
ds.itemType = Ci.nsIDocShellTreeItem.typeContent;
|
|
||||||
var xmlhttp = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"].
|
|
||||||
createInstance(Ci.nsIXMLHttpRequest);
|
|
||||||
xmlhttp.mozBackgroundRequest = true;
|
|
||||||
xmlhttp.open("GET", url, true);
|
|
||||||
xmlhttp.channel.loadGroup = ds.getInterface(Ci.nsILoadGroup);
|
|
||||||
xmlhttp.channel.loadFlags |= Ci.nsIChannel.LOAD_DOCUMENT_URI;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
var xmlhttp = Components.classes["@mozilla.org/xmlextras/xmlhttprequest;1"]
|
var xmlhttp = Components.classes["@mozilla.org/xmlextras/xmlhttprequest;1"]
|
||||||
.createInstance();
|
.createInstance();
|
||||||
|
|
||||||
// Prevent certificate/authentication dialogs from popping up
|
// Prevent certificate/authentication dialogs from popping up
|
||||||
xmlhttp.mozBackgroundRequest = true;
|
xmlhttp.mozBackgroundRequest = true;
|
||||||
xmlhttp.open('GET', url, true);
|
xmlhttp.open('GET', url, true);
|
||||||
|
|
||||||
// Send cookie even if "Allow third-party cookies" is disabled (>=Fx3.6 only)
|
// Send cookie even if "Allow third-party cookies" is disabled (>=Fx3.6 only)
|
||||||
if (!Zotero.isFx35) {
|
|
||||||
var channel = xmlhttp.channel;
|
var channel = xmlhttp.channel;
|
||||||
channel.QueryInterface(Components.interfaces.nsIHttpChannelInternal);
|
channel.QueryInterface(Components.interfaces.nsIHttpChannelInternal);
|
||||||
channel.forceAllowThirdPartyCookie = true;
|
channel.forceAllowThirdPartyCookie = true;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Don't cache GET requests
|
// Don't cache GET requests
|
||||||
xmlhttp.channel.loadFlags |= Components.interfaces.nsIRequest.LOAD_BYPASS_CACHE;
|
xmlhttp.channel.loadFlags |= Components.interfaces.nsIRequest.LOAD_BYPASS_CACHE;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user