commit a0c52a8892a1c1ae006964ea25e109203c6c1425
parent e3d7101923b318ef5ddd7448472e9a0e1d2c386e
Author: Simon Kornblith <simon@simonster.com>
Date: Tue, 9 Dec 2014 14:13:32 -0500
Merge pull request #594 from aurimasv/patch-1
Disable ZSA ping from bookmarklet in non-IE browsers
Diffstat:
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/chrome/content/zotero/xpcom/connector/connector.js b/chrome/content/zotero/xpcom/connector/connector.js
@@ -35,8 +35,20 @@ Zotero.Connector = new function() {
* @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);
+ if(Zotero.isBookmarklet && this.isOnline !== null) {
+ callback(this.isOnline);
+ return;
+ }
if(Zotero.isIE) {
if(window.location.protocol !== "http:") {
@@ -267,4 +279,4 @@ Zotero.Connector_Debug = new function() {
callback(true, reportID);
}, {"Content-Type":"text/plain"});
}
-}
-\ No newline at end of file
+}