Tweak timeouts and add additional debugging info for IE Standalone XDR

This commit is contained in:
Simon Kornblith 2013-04-15 13:18:21 -04:00
parent 00bb7a168b
commit 210e71b8a5

View file

@ -54,12 +54,17 @@ Zotero.Connector = new function() {
callback(false);
};
window.setTimeout(fail, 1000);
window.setTimeout(fail, 1200);
try {
var xdr = new XDomainRequest();
xdr.timeout = 700;
xdr.timeout = 1000;
xdr.open("POST", "http://127.0.0.1:23119/connector/ping", true);
xdr.onerror = xdr.ontimeout = fail
xdr.onerror = function() {
Zotero.debug("Connector: XDomainRequest to Zotero Standalone experienced an error");
};
xdr.ontimeout = function() {
Zotero.debug("Connector: XDomainRequest to Zotero Standalone timed out");
};
xdr.onload = function() {
if(me.isOnline !== null) return;
me.isOnline = true;