1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
7 /** @suppress {duplicate} */
8 var remoting = remoting || {};
11 * Returns full Chrome version.
14 remoting.getChromeVersion = function() {
15 var match = new RegExp('Chrome/([0-9.]*)').exec(navigator.userAgent);
16 if (match && (match.length >= 2)) {
23 * Returns Chrome major version.
26 remoting.getChromeMajorVersion = function() {
27 var match = new RegExp('Chrome/([0-9]+)\.').exec(navigator.userAgent);
28 if (match && (match.length >= 2)) {
29 return parseInt(match[1], 10);
35 * Returns whether the app is running on ChromeOS.
37 * @return {boolean} True if the app is running on ChromeOS.
39 remoting.runningOnChromeOS = function() {
40 return !!navigator.userAgent.match(/\bCrOS\b/);