From fa75beeefda4c9841e5d726061101908666041f0 Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Thu, 8 Jan 2015 01:46:20 -0500 Subject: [PATCH] Fix bookmarklet under Chrome checkIsOnline isn't called before the connector gets used except in IE. The mixed content blocker in modern IE combined with the https redirect breaks communication with ZSA on all pages anyway, so we may just want to give up on making the bookmarklet talk to ZSA. --- .../content/zotero/xpcom/connector/connector.js | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/chrome/content/zotero/xpcom/connector/connector.js b/chrome/content/zotero/xpcom/connector/connector.js index 57ab540a3..2c56ff403 100644 --- a/chrome/content/zotero/xpcom/connector/connector.js +++ b/chrome/content/zotero/xpcom/connector/connector.js @@ -28,22 +28,17 @@ Zotero.Connector = new function() { const CONNECTOR_API_VERSION = 2; var _ieStandaloneIframeTarget, _ieConnectorCallbacks; - this.isOnline = null; + // As of Chrome 38 (and corresponding Opera version 24?) pages loaded over + // https (i.e. the zotero bookmarklet iframe) can not send requests over + // http, so pinging Standalone at http://127.0.0.1 fails. + // Disable for all browsers, except IE, which may be used frequently with ZSA + this.isOnline = Zotero.isBookmarklet && !Zotero.isIE ? false : null; /** * Checks if Zotero is online and passes current status to callback * @param {Function} callback */ this.checkIsOnline = function(callback) { - // As of Chrome 38 (and corresponding Opera version 24?) pages loaded over - // https (i.e. the zotero bookmarklet iframe) can not send requests over - // http, so pinging Standalone at http://127.0.0.1 fails. - // Disable for all browsers, except IE, which may be used frequently with ZSA - if(Zotero.isBookmarklet && !Zotero.isIE) { - callback(false); - return; - } - // Only check once in bookmarklet if(Zotero.isBookmarklet && this.isOnline !== null) { callback(this.isOnline);