Merge pull request #236 from ronkorland/master

Add support for Chrome Headless user agent
This commit is contained in:
Faisal Salman
2017-05-17 09:49:29 +07:00
committed by GitHub
2 changed files with 15 additions and 2 deletions

View File

@@ -289,6 +289,9 @@
/xiaomi\/miuibrowser\/([\w\.]+)/i // MIUI Browser
], [VERSION, [NAME, 'MIUI Browser']], [
/(headlesschrome) ([\w\.]+)/i // Chrome Headless
], [VERSION, [NAME, 'Chrome Headless']], [
/\swv\).+(chrome)\/([\w\.]+)/i // Chrome WebView
], [[NAME, /(.+)/, '$1 WebView'], VERSION], [
@@ -844,7 +847,7 @@
mapper.rgx.call(os, ua, rgxmap.os);
return os;
};
this.getResult = function() {
this.getResult = function () {
return {
ua : this.getUA(),
browser : this.getBrowser(),
@@ -932,7 +935,7 @@
if (typeof $ !== UNDEF_TYPE) {
var parser = new UAParser();
$.ua = parser.getResult();
$.ua.get = function() {
$.ua.get = function () {
return parser.getUA();
};
$.ua.set = function (uastring) {