Merge pull request #310 from ricardorauber/master

Update the regexp for generic browsers
pull/325/head
Denis Demchenko 5 years ago committed by GitHub
commit e1a37ef4fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -606,9 +606,17 @@ const browsersList = [
{
test: [/.*/i],
describe(ua) {
/* Here we try to make sure that there are explicit details about the device
* in order to decide what regexp exactly we want to apply
* (as there is a specific decision based on that conclusion)
*/
const regexpWithoutDeviceSpec = /^(.*)\/(.*) /;
const regexpWithDeviceSpec = /^(.*)\/(.*)[ \t]\((.*)/;
const hasDeviceSpec = ua.search('\\(') !== -1;
const regexp = hasDeviceSpec ? regexpWithDeviceSpec : regexpWithoutDeviceSpec;
return {
name: Utils.getFirstMatch(/^(.*)\/(.*) /, ua),
version: Utils.getSecondMatch(/^(.*)\/(.*) /, ua),
name: Utils.getFirstMatch(regexp, ua),
version: Utils.getSecondMatch(regexp, ua),
};
},
},

@ -2269,6 +2269,19 @@
os: {}
platform: {}
engine: {}
-
ua: "Generic/2.15 (Macintosh; Intel Mac OS X 10_6_8)"
spec:
browser:
name: "Generic"
version: "2.15"
os:
name: "macOS"
version: "10.6.8"
platform:
type: "desktop"
vendor: "Apple"
engine: {}
Googlebot:
-
ua: "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"

Loading…
Cancel
Save