forked from faisalman/ua-parser-js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
34 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ npm-debug.log | |
Session.vim | ||
.netrwhist | ||
*~ | ||
.versions | ||
|
||
### OSX ### | ||
.DS_Store | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "ua-parser-js", | ||
"version": "0.7.4", | ||
"version": "0.7.5", | ||
"authors": [ | ||
"Faisal Salman <[email protected]>" | ||
], | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"title": "UAParser.js", | ||
"name": "ua-parser-js", | ||
"version": "0.7.4", | ||
"version": "0.7.5", | ||
"author": "Faisal Salman <[email protected]> (http://faisalman.com)", | ||
"description": "Lightweight JavaScript-based user-agent string parser", | ||
"keywords": [ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# UAParser.js | ||
|
||
Lightweight JavaScript-based User-Agent string parser. Supports browser & node.js environment. Also available as jQuery/Zepto plugin, Component package, Bower package, & AMD module | ||
Lightweight JavaScript-based User-Agent string parser. Supports browser & node.js environment. Also available as jQuery/Zepto plugin, Component package, Bower package, Meteor package, & AMD module | ||
|
||
[](https://travis-ci.org/faisalman/ua-parser-js) | ||
|
||
|
@@ -221,6 +221,12 @@ console.log(parser.getResult()); | |
$ bower install ua-parser-js | ||
``` | ||
|
||
### Using meteor | ||
|
||
```sh | ||
$ meteor add faisalman:ua-parser-js | ||
``` | ||
|
||
### Using jQuery/Zepto ($.ua) | ||
|
||
Although written in vanilla js (which means it doesn't depends on jQuery), this library will automatically detect if jQuery/Zepto is present and create `$.ua` object based on browser's user-agent (although in case you need, `window.UAParser` constructor is still present). To get/set user-agent you can use: `$.ua.get()` / `$.ua.set(uastring)`. | ||
|
@@ -259,7 +265,7 @@ Then submit a pull request to https://github.com/faisalman/ua-parser-js under `d | |
|
||
Dual licensed under GPLv2 & MIT | ||
|
||
Copyright © 2012-2014 Faisal Salman <<[email protected]>> | ||
Copyright © 2012-2015 Faisal Salman <<[email protected]>> | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of | ||
this software and associated documentation files (the "Software"), to deal in | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
/** | ||
* UAParser.js v0.7.4 | ||
* UAParser.js v0.7.5 | ||
* Lightweight JavaScript-based User-Agent string parser | ||
* https://github.com/faisalman/ua-parser-js | ||
* | ||
* Copyright © 2012-2014 Faisal Salman <[email protected]> | ||
* Copyright © 2012-2015 Faisal Salman <[email protected]> | ||
* Dual licensed under GPLv2 & MIT | ||
*/ | ||
|
||
|
@@ -16,7 +16,7 @@ | |
///////////// | ||
|
||
|
||
var LIBVERSION = '0.7.4', | ||
var LIBVERSION = '0.7.5', | ||
EMPTY = '', | ||
UNKNOWN = '?', | ||
FUNC_TYPE = 'function', | ||
|
@@ -734,10 +734,10 @@ | |
//////////////// | ||
|
||
|
||
var UAParser = function (uastring, extensions) { | ||
var _UAParser = function (uastring, extensions) { | ||
|
||
if (!(this instanceof UAParser)) { | ||
return new UAParser(uastring, extensions).getResult(); | ||
if (!(this instanceof _UAParser)) { | ||
return new _UAParser(uastring, extensions).getResult(); | ||
} | ||
|
||
var ua = uastring || ((window && window.navigator && window.navigator.userAgent) ? window.navigator.userAgent : EMPTY); | ||
|
@@ -781,16 +781,16 @@ | |
return this; | ||
}; | ||
|
||
UAParser.VERSION = LIBVERSION; | ||
UAParser.BROWSER = { | ||
_UAParser.VERSION = LIBVERSION; | ||
_UAParser.BROWSER = { | ||
NAME : NAME, | ||
MAJOR : MAJOR, | ||
VERSION : VERSION | ||
}; | ||
UAParser.CPU = { | ||
_UAParser.CPU = { | ||
ARCHITECTURE : ARCHITECTURE | ||
}; | ||
UAParser.DEVICE = { | ||
_UAParser.DEVICE = { | ||
MODEL : MODEL, | ||
VENDOR : VENDOR, | ||
TYPE : TYPE, | ||
|
@@ -801,11 +801,11 @@ | |
WEARABLE: WEARABLE, | ||
EMBEDDED: EMBEDDED | ||
}; | ||
UAParser.ENGINE = { | ||
_UAParser.ENGINE = { | ||
NAME : NAME, | ||
VERSION : VERSION | ||
}; | ||
UAParser.OS = { | ||
_UAParser.OS = { | ||
NAME : NAME, | ||
VERSION : VERSION | ||
}; | ||
|
@@ -818,12 +818,17 @@ | |
|
||
// check js environment | ||
if (typeof(exports) !== UNDEF_TYPE) { | ||
var UAParser = _UAParser; | ||
// nodejs env | ||
if (typeof(module) !== UNDEF_TYPE && module.exports) { | ||
exports = module.exports = UAParser; | ||
} | ||
exports.UAParser = UAParser; | ||
} else if (typeof(Package) !== UNDEF_TYPE) { | ||
// meteor | ||
UAParser = _UAParser; | ||
} else { | ||
var UAParser = _UAParser; | ||
// browser env | ||
window.UAParser = UAParser; | ||
// requirejs env (optional) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters