Merge pull request +15368 from c9/ide-safari-bug-warning

warn about broken safari version
This commit is contained in:
Harutyun Amirjanyan 2017-04-24 18:47:08 +04:00 committed by GitHub
commit 5eeb9aa658
3 changed files with 22 additions and 2 deletions

View File

@ -310,6 +310,12 @@ function(require, module, exports) {
this.isLinux = Browser.Platform.linux;
this.isIphone = Browser.Platform.ios || UA.indexOf("aspen simulator") != -1;
this.versionWebkit = this.isWebkit ? Browser.version : null;
this.versionGecko = this.isGecko ? Browser.version : null;
this.versionFF = this.isGecko ? Browser.version : null;
this.versionSafari = this.isSafari ? Browser.version : null;
this.versionChrome = this.isChrome ? Browser.version : null;
this.versionOpera = this.isOpera ? Browser.version : null;
},
/**

View File

@ -3,7 +3,7 @@ define(function(require, exports, module) {
main.consumes = [
"Plugin", "auth", "vfs.endpoint", "dialog.error",
"dialog.alert", "error_handler", "metrics"
"dialog.alert", "error_handler", "metrics", "apf"
];
main.provides = ["vfs"];
return main;
@ -32,6 +32,7 @@ define(function(require, exports, module) {
var showAlert = imports["dialog.alert"].show;
var errorHandler = imports.error_handler;
var metrics = imports.metrics;
var apf = imports.apf;
var eio = require("engine.io");
var Consumer = require("vfs-socket/consumer").Consumer;
@ -137,6 +138,8 @@ define(function(require, exports, module) {
});
}
}
plugin.once("connect", warnBrokenSafariVersion);
}
/***** Methods *****/
@ -279,6 +282,16 @@ define(function(require, exports, module) {
console.error("Fatal connection error:", err);
}
function warnBrokenSafariVersion() {
if (apf.isSafari && apf.versionSafari == "10.1") {
showAlert("Broken Browser Version Detected", "Websockets are broken in Safari version 10.1.",
"Due to https://bugs.webkit.org/show_bug.cgi?id=170463, websockets do not work well"
+ " on this browser version which may result in frequent disconnects from the service."
+ " Please use Chrome, 'Safari Technology Preview' or another browser "
+ " until the Safari updates to version 10.2.");
}
}
function onDisconnect() {
vfs = null;
emit("disconnect");
@ -458,4 +471,4 @@ define(function(require, exports, module) {
"vfs": plugin
});
}
});
});

View File

@ -90,6 +90,7 @@ require([
x.connected = true;
return x;
})(),
apf: {},
vfs: (function() {
var x = new EventEmitter();
return x;