Update V8 to version 3.30.4 (based on bleeding_edge revision r24443)
[chromium-blink-merge.git] / remoting / webapp / platform.js
blobab01cc7443cca63a97285b21f864a2b11602cc21
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.
5 'use strict';
7 /** @suppress {duplicate} */
8 var remoting = remoting || {};
10 /**
11 * Returns full Chrome version.
12 * @return {string?}
14 remoting.getChromeVersion = function() {
15 var match = new RegExp('Chrome/([0-9.]*)').exec(navigator.userAgent);
16 if (match && (match.length >= 2)) {
17 return match[1];
19 return null;
22 /**
23 * Returns Chrome major version.
24 * @return {number}
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);
31 return 0;
34 /**
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/);