www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit fa75beeefda4c9841e5d726061101908666041f0
parent 541ebd1f22b1c922bbcff62bac18eb6255ea427b
Author: Simon Kornblith <simon@simonster.com>
Date:   Thu,  8 Jan 2015 01:46:20 -0500

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.

Diffstat:
Mchrome/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 @@ -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);