Merge pull request #594 from aurimasv/patch-1
Disable ZSA ping from bookmarklet in non-IE browsers
This commit is contained in:
commit
a0c52a8892
1 changed files with 14 additions and 2 deletions
|
@ -35,8 +35,20 @@ Zotero.Connector = new function() {
|
||||||
* @param {Function} callback
|
* @param {Function} callback
|
||||||
*/
|
*/
|
||||||
this.checkIsOnline = 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
|
// 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(Zotero.isIE) {
|
||||||
if(window.location.protocol !== "http:") {
|
if(window.location.protocol !== "http:") {
|
||||||
|
|
Loading…
Reference in a new issue