OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 'use strict'; | 5 'use strict'; |
6 | 6 |
7 /** @suppress {duplicate} */ | 7 /** @suppress {duplicate} */ |
8 var remoting = remoting || {}; | 8 var remoting = remoting || {}; |
9 | 9 |
10 /** | 10 /** |
(...skipping 12 matching lines...) Expand all Loading... |
23 * Returns Chrome major version. | 23 * Returns Chrome major version. |
24 * @return {number} | 24 * @return {number} |
25 */ | 25 */ |
26 remoting.getChromeMajorVersion = function() { | 26 remoting.getChromeMajorVersion = function() { |
27 var match = new RegExp('Chrome/([0-9]+)\.').exec(navigator.userAgent); | 27 var match = new RegExp('Chrome/([0-9]+)\.').exec(navigator.userAgent); |
28 if (match && (match.length >= 2)) { | 28 if (match && (match.length >= 2)) { |
29 return parseInt(match[1], 10); | 29 return parseInt(match[1], 10); |
30 } | 30 } |
31 return 0; | 31 return 0; |
32 }; | 32 }; |
33 | |
34 /** | |
35 * Returns whether the app is running on ChromeOS. | |
36 * | |
37 * @return {boolean} True if the app is running on ChromeOS. | |
38 */ | |
39 remoting.runningOnChromeOS = function() { | |
40 return !!navigator.userAgent.match(/\bCrOS\b/); | |
41 } | |
OLD | NEW |