diff --git a/plugins/c9.ide.ui/lib_apf.js b/plugins/c9.ide.ui/lib_apf.js index 8962536d..ae4b71ce 100644 --- a/plugins/c9.ide.ui/lib_apf.js +++ b/plugins/c9.ide.ui/lib_apf.js @@ -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; }, /** diff --git a/plugins/c9.vfs.client/vfs_client.js b/plugins/c9.vfs.client/vfs_client.js index 7a0c9252..2ad7b669 100644 --- a/plugins/c9.vfs.client/vfs_client.js +++ b/plugins/c9.vfs.client/vfs_client.js @@ -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 }); } -}); \ No newline at end of file +}); diff --git a/plugins/c9.vfs.standalone/www/test.js b/plugins/c9.vfs.standalone/www/test.js index ddd04b35..b38c4cdf 100644 --- a/plugins/c9.vfs.standalone/www/test.js +++ b/plugins/c9.vfs.standalone/www/test.js @@ -90,6 +90,7 @@ require([ x.connected = true; return x; })(), + apf: {}, vfs: (function() { var x = new EventEmitter(); return x;