mirror of
https://github.com/lancedikson/bowser
synced 2026-03-02 03:40:27 +00:00
fist commit
This commit is contained in:
28
src/parser.js
Normal file
28
src/parser.js
Normal file
@@ -0,0 +1,28 @@
|
||||
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;
|
||||
Reference in New Issue
Block a user