You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
526 B
29 lines
526 B
7 years ago
|
var browsers = require('./parser-browsers');
|
||
|
|
||
|
class Parser {
|
||
|
constructor(UA) {
|
||
|
this._ua = UA;
|
||
|
this.result = {};
|
||
|
}
|
||
|
|
||
|
parseBrowser() {
|
||
|
if (this.result.browser) {
|
||
|
return this.result.browser;
|
||
|
}
|
||
|
|
||
|
const browser = browsers.find((browser) => {
|
||
|
return browser.test.some((result, item) => { item.test(this._ua)});
|
||
|
});
|
||
|
}
|
||
|
|
||
|
parseBrowserName() {}
|
||
|
parseBrowserVersion() {}
|
||
|
parsePlatform(){}
|
||
|
parseOS(){}
|
||
|
parseOSName(){}
|
||
|
parseOSVersion(){}
|
||
|
parseFullInfo(){}
|
||
|
}
|
||
|
|
||
|
module.exports = Parser;
|