1
0
mirror of https://github.com/lancedikson/bowser synced 2024-10-27 20:34:22 +00:00

Change Bowser's constructor

This commit is contained in:
Denis Demchenko 2017-06-09 01:12:21 +03:00
parent 2c8f17b037
commit 38320b1409

View File

@ -27,55 +27,11 @@ class Bowser {
if (!UA) {
throw new Error('UserAgent is not defined');
}
this._ua = UA;
this._parser = new Parser(UA);
return new Parser(UA);
}
/**
* Get browser's version
* @returns {String}
*/
getBrowserVersion() {
return this._parser.getBrowserVersion();
}
/**
* Get a browser's name
* @returns {String}
*/
getBrowserName() {
return this._parser.getBrowserName();
}
/**
* Get an object with a name and version of the browser
* @returns {Object}
*/
getBrowser() {
return this._parser.getBrowser();
}
/**
* Get an object with a name and version of the OS if it's defined
* @returns {Object}
*/
getOS() {
return this._parser.getOS();
}
/**
* Get name of OS
* @returns {String}
*/
getOSName() {
return this._parser.getOSName();
}
/**
* Get OS version
*/
getOSVersion() {
return this._parser.getOSVersion();
static parse(UA) {
return new this.constructor(UA).getResult();
}
/**