Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 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. | |
| 4 | |
| 5 WebInspector.BrowserVersionInfo = { | |
|
pfeldman
2016/09/14 21:47:09
This is no longer browser version info, also you d
luoe
2016/09/14 22:49:13
There are 2 places where we could use this patchin
pfeldman
2016/09/15 21:44:06
"sdk" would be the common denominator then, you ca
luoe
2016/09/15 23:18:08
Done.
| |
| 6 DefaultChromeVersion: "54.0.2834.0", | |
|
pfeldman
2016/09/14 21:47:09
I'd leave these hardcoded in the config view and o
luoe
2016/09/14 22:49:13
Done.
| |
| 7 | |
| 8 /** | |
| 9 * @param {string} uaString | |
| 10 * @return {string} | |
| 11 */ | |
| 12 patchUserAgentWithChromeVersion: function(uaString) | |
| 13 { | |
| 14 // Extracts Chrome version from user agent ("1.2.3.4" when user agent is : "Chrome/1.2.3.4"). | |
| 15 var sectionRegex = new RegExp("(?:^|\\W)Chrome/(\\S+)"); | |
|
pfeldman
2016/09/14 21:47:09
var regex = /Chrome\/[\d.]+/;
var version = naviga
luoe
2016/09/14 22:49:13
Regex: I think the "(?:^|\\W)" is warranted so tha
pfeldman
2016/09/15 21:44:06
- If XChrome gets into the UA string, this means t
luoe
2016/09/15 23:18:08
If there is an XChrome in the staleAgent, we will
| |
| 16 var sectionMatch = navigator.userAgent.match(sectionRegex); | |
| 17 var version = WebInspector.BrowserVersionInfo.DefaultChromeVersion; | |
| 18 if (sectionMatch && sectionMatch.length > 1) | |
| 19 version = sectionMatch[1]; | |
| 20 return String.sprintf(uaString, version); | |
| 21 } | |
| 22 }; | |
| OLD | NEW |