diff options
author | lambroslambrou@chromium.org <lambroslambrou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-03 19:00:02 +0000 |
---|---|---|
committer | lambroslambrou@chromium.org <lambroslambrou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-03 19:00:02 +0000 |
commit | 7c36b36400069e832fef3a65f86f9c71802b5d22 (patch) | |
tree | ea73b35cd15e49dced2cb2de906d3e07482e26b9 /remoting/webapp/host_native_messaging.js | |
parent | 8889b9e35817a6df9e7d6fb8f53de16643ce572a (diff) | |
download | chromium_src-7c36b36400069e832fef3a65f86f9c71802b5d22.zip chromium_src-7c36b36400069e832fef3a65f86f9c71802b5d22.tar.gz chromium_src-7c36b36400069e832fef3a65f86f9c71802b5d22.tar.bz2 |
Blacklist Chrome <= 26.xxx for Native Messaging
On these versions of Chrome, the "hello" exchange fails to trigger the
onDisconnect() handler on error. This makes it impossible to determine that
Native Messaging is unsupported.
BUG=225884
Review URL: https://chromiumcodereview.appspot.com/13421004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@192112 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/webapp/host_native_messaging.js')
-rw-r--r-- | remoting/webapp/host_native_messaging.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/remoting/webapp/host_native_messaging.js b/remoting/webapp/host_native_messaging.js index 0ccb876..c0dff97 100644 --- a/remoting/webapp/host_native_messaging.js +++ b/remoting/webapp/host_native_messaging.js @@ -55,6 +55,16 @@ remoting.HostNativeMessaging.prototype.initialize = function(onDone) { return; } + // NativeMessaging API exists on Chrome 26.xxx but fails to notify + // onDisconnect in the case where the Host components are not installed. Need + // to blacklist these versions of Chrome. + var majorVersion = navigator.appVersion.match('Chrome/(\\d+)\.')[1]; + if (!majorVersion || majorVersion <= 26) { + console.log('Native Messaging not supported on this version of Chrome'); + onDone(false); + return; + } + try { this.port_ = chrome.runtime.connectNative( 'com.google.chrome.remote_desktop'); |