Make IE standalone contact attempt time out, and connector error tweak in case connector can't be contacted at all
This commit is contained in:
parent
fbb0511c53
commit
dc2d417c3d
|
@ -49,6 +49,7 @@ Zotero.Connector = new function() {
|
||||||
Zotero.debug("Connector: Looking for Zotero Standalone");
|
Zotero.debug("Connector: Looking for Zotero Standalone");
|
||||||
try {
|
try {
|
||||||
var xdr = new XDomainRequest();
|
var xdr = new XDomainRequest();
|
||||||
|
xdr.timeout = 700;
|
||||||
xdr.open("POST", "http://127.0.0.1:23119/connector/ping", true);
|
xdr.open("POST", "http://127.0.0.1:23119/connector/ping", true);
|
||||||
xdr.onerror = xdr.ontimeout = function() {
|
xdr.onerror = xdr.ontimeout = function() {
|
||||||
Zotero.debug("Connector: Zotero Standalone is not online or cannot be contacted");
|
Zotero.debug("Connector: Zotero Standalone is not online or cannot be contacted");
|
||||||
|
@ -137,7 +138,7 @@ Zotero.Connector = new function() {
|
||||||
if(callback) callback(false, req.status);
|
if(callback) callback(false, req.status);
|
||||||
|
|
||||||
// Check for incompatible version
|
// Check for incompatible version
|
||||||
if(req.status === 404 || req.status === 412) {
|
if(req.status === 412) {
|
||||||
if(Zotero.Connector_Browser && Zotero.Connector_Browser.onIncompatibleStandaloneVersion) {
|
if(Zotero.Connector_Browser && Zotero.Connector_Browser.onIncompatibleStandaloneVersion) {
|
||||||
var standaloneVersion = req.getResponseHeader("X-Zotero-Version");
|
var standaloneVersion = req.getResponseHeader("X-Zotero-Version");
|
||||||
Zotero.Connector_Browser.onIncompatibleStandaloneVersion(Zotero.version, standaloneVersion);
|
Zotero.Connector_Browser.onIncompatibleStandaloneVersion(Zotero.version, standaloneVersion);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user