GH-281: Improve parsing of Google Pixel user agent

Fixes GH-281
This commit is contained in:
Jon Siwek 2019-02-25 14:07:53 -06:00
parent a342090f18
commit 53dc1176b7
3 changed files with 48 additions and 17 deletions

View file

@ -147,6 +147,22 @@ function parse(unparsed_version: string): Description
{
return parse_mozilla(unparsed_version);
}
else if ( /A\/[0-9\.]*\/Google\/Pixel/ in unparsed_version )
{
software_name = "Android (Google Pixel)";
local parts = split_string_all(unparsed_version, /\//);
if ( 2 in parts )
{
local vs = parts[2];
if ( "." in vs )
v = parse(vs)$version;
else
v = Version($major=extract_count(vs));
return [$version=v, $unparsed_version=unparsed_version, $name=software_name];
}
}
else
{
# The regular expression should match the complete version number