mirror of
https://github.com/faisalman/ua-parser-js.git
synced 2025-09-27 16:08:47 +03:00
Move feature detection to its own dedicated method
This commit is contained in:
parent
4711805a1c
commit
b385a73340
@ -964,14 +964,7 @@
|
||||
}
|
||||
return this;
|
||||
}
|
||||
UAParserItem.prototype.get = function (prop) {
|
||||
if (!prop) return this.data;
|
||||
return this.data.hasOwnProperty(prop) ? this.data[prop] : undefined;
|
||||
};
|
||||
UAParserItem.prototype.parseUA = function () {
|
||||
if (this.itemType != UA_RESULT) {
|
||||
rgxMapper.call(this.data, this.ua, this.rgxMap);
|
||||
}
|
||||
UAParserItem.prototype.detectFeature = function () {
|
||||
var isSelfNav = NAVIGATOR && NAVIGATOR.userAgent == this.ua;
|
||||
switch(this.itemType) {
|
||||
case UA_BROWSER:
|
||||
@ -998,6 +991,17 @@
|
||||
}
|
||||
return this;
|
||||
};
|
||||
UAParserItem.prototype.get = function (prop) {
|
||||
if (!prop) return this.data;
|
||||
return this.data.hasOwnProperty(prop) ? this.data[prop] : undefined;
|
||||
};
|
||||
UAParserItem.prototype.parseUA = function () {
|
||||
if (this.itemType != UA_RESULT) {
|
||||
rgxMapper.call(this.data, this.ua, this.rgxMap);
|
||||
}
|
||||
this.detectFeature();
|
||||
return this;
|
||||
};
|
||||
UAParserItem.prototype.parseCH = function () {
|
||||
var ua = this.ua,
|
||||
uaCH = this.uaCH,
|
||||
|
Loading…
x
Reference in New Issue
Block a user