Compare commits

...

389 Commits

Author SHA1 Message Date
Faisal Salman
7aca357879 Fix #328 New release 0.7.19 2018-10-26 01:35:15 +07:00
Faisal Salman
7f8f357995 Remove Node 0.10 from Travis 2018-10-26 01:17:13 +07:00
Faisal Salman
0fd919bd51 Merge branch 'develop' of github.com:faisalman/ua-parser-js into develop 2018-10-26 00:53:15 +07:00
Faisal Salman
a400d2163c Fix #347 Pixel C in Chrome 70 2018-10-26 00:52:27 +07:00
Faisal Salman
073c672af5 Add OS: Fuchsia 2018-10-26 00:48:05 +07:00
Faisal Salman
93e17524c0 Add OS: Fuchsia 2018-10-26 00:37:15 +07:00
Faisal Salman
2c7e61f9a2 Add Device: Essential & Google Pixel 2018-10-26 00:35:59 +07:00
Faisal Salman
87c6e5c1bd Merge pull request #346 from 8thwall/essential
Detect Essential Phone (PH-1)
2018-10-25 23:00:59 +07:00
Faisal Salman
b88c52131f Merge pull request #345 from 8thwall/pixel3
Add Pixel 2 XL, Pixel 3, Pixel 3 XL Device Models
2018-10-25 22:56:46 +07:00
Alvin Portillo
6c2a767e32 Add Pixel 2 XL, Pixel 3, Pixel 3 XL Device Models 2018-10-22 11:28:31 -07:00
Alvin Portillo
7dbf0c6867 Detect Essential Phone (PH-1) 2018-10-22 10:29:19 -07:00
Faisal Salman
0304152f72 Merge branch 'master' of github.com:faisalman/ua-parser-js 2018-10-21 15:21:53 +07:00
Faisal Salman
4cc29dd88c Update readme: using TypeScript 2018-10-21 15:21:03 +07:00
Faisal Salman
95fcd3f672 Fix #321: Add a LICENSE to be recognized by GitHub API 2018-10-13 10:01:51 +07:00
Faisal Salman
d7608d0459 Merge pull request #338 from coox/master
Fix browser detection of Edge on Android
2018-10-06 23:32:20 +07:00
Faisal Salman
f8820389a9 Merge branch 'develop' into master 2018-10-06 23:30:37 +07:00
Faisal Salman
46b9f0f2aa Merge pull request #334 from vladimyr/develop
Detect Firefox Focus & Opera Touch
2018-10-06 23:28:47 +07:00
Faisal Salman
41ccecadea Merge pull request #333 from brave/master
add Brave to list of browsers
2018-10-06 23:28:29 +07:00
Eric Redon
964431ef89 Fix browser detection of Edge on Android 2018-09-27 17:50:54 +02:00
Dario Vladovic
bf79eabecc Improve Microsoft Edge detection 2018-09-16 12:19:47 +02:00
Dario Vladovic
01eab85f7d Add Opera Touch & Firefox Focus, fix Microsoft Edge 2018-09-16 12:07:18 +02:00
Dario Vladovic
384bafe31c Prevent package-lock creation 2018-09-16 11:46:11 +02:00
Dario Vladovic
eb83122c5e Update .gitignore 2018-09-16 11:40:03 +02:00
Matthew O
64bd8a4e60 Merge pull request #1 from KarateCowboy/add-brave
add Brave browser
2018-09-14 16:05:27 -05:00
Matthew Origer
fc4c0df095 add Brave browser 2018-09-14 15:57:26 -05:00
Faisal Salman
a142c0ee94 Update filesize description 2018-09-08 16:13:45 +07:00
Faisal Salman
5c30aeed59 Merge branch 'master' of github.com:faisalman/ua-parser-js 2018-09-08 16:07:57 +07:00
Faisal Salman
00064be6d6 Merge pull request #325 from dcyriller/update-readme
Update browser names in README
2018-09-08 16:04:28 +07:00
Faisal Salman
76be1cb328 Fix test for Meizu device 2018-09-08 14:21:36 +07:00
Faisal Salman
d601ab195f Merge branch 'shchotse-add_true_meizu_device_type' into develop 2018-09-08 14:19:00 +07:00
Faisal Salman
ac3b0624b8 Identify MZ as Meizu #263 2018-09-08 14:17:22 +07:00
Cyrille David
b49865266c Update browser names in README 2018-07-26 11:58:21 +02:00
Cyrille David
565d67bbb6 Remove unconsistant (because outdated?) names
Only remove names coming from README.
2018-07-26 11:42:45 +02:00
Cyrille David
58c71a019e Merge README list into extraction 2018-07-26 11:40:11 +02:00
Cyrille David
8c2607aac9 Extract browser names from test/browser-test.json 2018-07-26 11:36:10 +02:00
Faisal Salman
55ffb10a5f Fix #259: Avoid collision when using $.ua 2018-05-23 20:28:47 +07:00
Faisal Salman
1493587742 Fix #317: Add missing warranty section of MIT license in readme.md 2018-05-17 06:19:13 +07:00
Faisal Salman
f5e0aa83eb Fix #290: Add Device Model: Pixel 2 2018-05-08 15:26:38 +07:00
Faisal Salman
8fdc32f5b8 Fix #295: Detect Amazon Fire TV 2018-05-06 22:42:14 +07:00
Faisal Salman
0059eef770 Fix #293: Detect ARM on ChromeOS 2018-05-06 22:26:16 +07:00
Faisal Salman
93affc671c Replace donation button 2018-05-06 22:17:10 +07:00
Faisal Salman
a3f5efa680 Fix #212: Detect LINE 2018-05-06 22:10:39 +07:00
Faisal Salman
4c00ccc6c2 Fix #271 2018-05-06 21:05:30 +07:00
Faisal Salman
34f934fa55 increment patch version 2018-05-04 23:13:57 +07:00
Faisal Salman
218e3a4a3b Merge pull request #314 from no5no6/master
Add support for Sogou Browser、LieBao Browser、Baidu Browser、2345 Browser
2018-05-04 08:52:35 +07:00
yuanyang
5eda2491b1 Merge branch 'master' of https://github.com/no5no6/ua-parser-js 2018-05-02 10:55:52 +08:00
yuanyang
7acaf9ced8 add Sogou Browser、LieBao Browser、Baidu Browser、2345 Browser 2018-05-02 10:54:54 +08:00
Faisal Salman
bafac18512 Merge pull request #312 from brophdawg11/qqbrowserlite
#311 - Add support for QQBrowserLite
2018-04-29 22:03:03 +07:00
Faisal Salman
ee553df245 Merge branch 'develop' into qqbrowserlite 2018-04-29 22:02:07 +07:00
Faisal Salman
bc4e75573a Merge pull request #305 from shreedharshetty/shreedharshetty-patch-1
Incorrect browser name shows for Edge browser on mobile
2018-04-29 21:58:34 +07:00
Faisal Salman
378dee1aaa Merge pull request #310 from JoshuaKGoldberg/patch-1
Readme typo: missing "be more"
2018-04-29 21:57:29 +07:00
Faisal Salman
d413cb0745 Merge branch 'develop' into shreedharshetty-patch-1 2018-04-29 21:56:34 +07:00
Faisal Salman
7fb860f030 Merge pull request #304 from gulping/patch-1
mark license comment as important
2018-04-29 21:52:39 +07:00
Faisal Salman
2e57a9778f Merge pull request #299 from zbjornson/vulnfix
Fix vulnerable RegExps
2018-04-29 21:52:23 +07:00
yuanyang
fb92a46479 add Sogou Browser、LieBao Browser、Baidu Browser、2345 Browser 2018-04-25 12:02:19 +08:00
Matt Brophy
4790f944bf Update README 2018-04-23 09:37:13 -04:00
Matt Brophy
3ed9d3f4ff #311 - Add support for QQBrowserLite 2018-04-23 09:36:11 -04:00
Josh Goldberg
0c6ae1a1e3 Readme typo: missing "be more" 2018-04-21 16:10:42 -07:00
Shreedhar
84bfaaf225 updated ua string for ios 2018-04-02 20:09:57 +05:30
Shreedhar
9ceb402834 fix: wrong browser name returns for edge browsers on mobiles 2018-04-02 19:52:18 +05:30
gulpin
a795cf83c4 mark license comment as important 2018-03-29 16:41:58 +09:00
Zach Bjornson
8b54a7256e Fix vulnerable RegExps
Fixes #298
2018-02-26 20:12:16 -08:00
Faisal Salman
dfb8e758d1 Merge pull request #287 from m90/patch-1
Add missing Waterfox browser to README
2018-01-11 23:24:03 +07:00
Frederik Ring
083cb66d46 Add missing Waterfox browser to README 2018-01-11 13:04:00 +01:00
Faisal Salman
50bd78afb1 Fix ReDoS vulnerability reported by Sonatype 2017-12-26 15:30:33 +07:00
Faisal Salman
ac7f87f199 Fix #272 OnePlus 2017-12-26 10:55:27 +07:00
Faisal Salman
b367a3f741 Update contributors 2017-12-26 08:29:40 +07:00
Faisal Salman
4bbd7bd27c Merge pull request #286 from loris/master
Add support for Xiaomi Mi 1/2/3/4/5/6 mobile smartphones
2017-12-18 22:49:18 +07:00
Loris Guignard
610781dac3 Add support for "Mi 5s Plus" 2017-12-15 16:32:51 +01:00
Loris Guignard
1b86f8fb94 Xiaomi tablets: Ensure the UA contains "pad" 2017-12-15 16:32:33 +01:00
Loris Guignard
0413755986 Revert /dist files 2017-12-15 16:16:39 +01:00
Loris Guignard
618c92aec9 Add support for Xiaomi Mi 1/2/3/4/5/6 mobile smartphones 2017-12-15 15:56:27 +01:00
Faisal Salman
7964f909a3 Merge pull request #280 from stiekel/master
Add Quark Browser support
2017-12-01 09:02:13 +07:00
Faisal Salman
934e077aea Merge pull request #281 from dhoko/feat/waterfox
Add support for waterfox
2017-12-01 09:01:46 +07:00
dhoko
503bb6eb06 Add support for waterfox 2017-11-29 09:11:17 +01:00
Stiekel
435335e12f Add Quark Browser support 2017-11-24 17:30:38 +08:00
Faisal Salman
a6e1ed6392 Merge pull request #278 from dhoko/feat/palemoon
Add support for palemoon browser + basilisk
2017-11-21 16:30:20 +07:00
dhoko
9dfeee5211 Add support for palemoon browser + basilisk 2017-11-21 10:25:30 +01:00
Faisal Salman
ce2a8a3939 Merge pull request #274 from bulbulpaul/fix_license
Fixed license
2017-11-21 13:18:11 +07:00
Nobuo Okada
46dfe2aeb8 Fixed license 2017-11-01 13:18:26 +09:00
Faisal Salman
9c06febfce Merge pull request #273 from bulbulpaul/fix-license
Fixed license
2017-10-31 20:05:01 +07:00
Nobuo Okada
a75de42f8e Fixed license 2017-10-31 18:59:41 +09:00
Faisal Salman
6095258673 Fix #268 revert changes 2017-10-12 15:16:23 +07:00
Faisal Salman
40aa1a693b bump version 2017-10-12 12:10:08 +07:00
Faisal Salman
25e143ee7c Fix vulnerable regex in getOS() (as reported by Nick Starke) 2017-10-12 12:07:10 +07:00
Faisal Salman
7bd9ffea24 Fix #262 Chrome Headless 2017-10-12 09:48:25 +07:00
Faisal Salman
c566f45cbd Merge branch 'master' into develop 2017-10-12 09:39:37 +07:00
Faisal Salman
3b89dff771 increment revision 0.7.15 2017-10-12 09:28:14 +07:00
Faisal Salman
5ba5e7abc9 Merge branch 'develop' of github.com:faisalman/ua-parser-js into develop 2017-10-12 09:19:03 +07:00
Faisal Salman
b8978f5933 Fix #262 Chrome Headless 2017-10-12 09:18:42 +07:00
Faisal Salman
eeb1b9ef81 Merge pull request #265 from brophdawg11/support-ios-gsa
Add support for Google Search Appliance on iOS
2017-10-11 21:35:06 +07:00
Faisal Salman
aeae29be66 Merge pull request #267 from LukasDrgon/patch-1
Add CDN link
2017-10-11 20:48:39 +07:00
Lukas Drgon
3ce12c0cf9 Add CDN link 2017-10-02 19:31:03 +02:00
Matt Brophy
4d95ac10ef Add support for Google Search Appliance on iOS 2017-09-19 14:19:32 -04:00
Faisal Salman
61b4a089c5 Merge pull request #264 from arunrreddy/support-device-redmi
Support device redmi
2017-09-17 06:02:39 +07:00
Arun Rama Reddy
74ec93ffb6 feat: Added Redmi phone and Mi Pad tablet detection support 2017-09-16 11:12:29 +05:30
Igor Topal
2c28b3e97e Add new Meizu device type (MZ) support, for correctly parsing 2017-09-08 17:47:07 +03:00
Faisal Salman
459f3d34f5 Issue #258 0.7.15rc 2017-08-06 08:27:02 +07:00
Faisal Salman
6f621f1ae2 New feature: CLI support 2017-08-06 07:55:22 +07:00
Faisal Salman
7ae3098778 Fix #256 tag new release 0.7.14 2017-07-19 19:39:01 +07:00
Faisal Salman
806c2b8030 move jquery.json to package.json 2017-07-19 19:35:42 +07:00
Faisal Salman
cb1a64b509 Merge some commits from branch 'develop' 2017-07-17 23:14:19 +07:00
Faisal Salman
b49cfae4e2 Opening donation 2017-07-17 22:54:45 +07:00
Faisal Salman
91b046462c Merge branch 'master' of github.com:faisalman/ua-parser-js 2017-07-17 22:51:38 +07:00
Faisal Salman
69509af6dd Merge pull request #254 from hr6r/develop
+ browser inside QQ support
2017-07-05 19:01:27 +07:00
Faisal Salman
225f703b67 Merge pull request #231 from motnik/develop
Added Multiple Tablets Detection (LG, RCA, Dell, Verizon, etc.)
2017-07-05 19:00:02 +07:00
dianhe
7f217753f5 + browser inside QQ support 2017-07-05 19:55:19 +08:00
Faisal Salman
10f9fb35ca Merge pull request #234 from Kronuz/patch-1
Fix server side rendering
2017-07-05 18:38:48 +07:00
Faisal Salman
5ae468a3d3 uastring is optional when using extensions 2017-07-01 20:28:03 +07:00
Faisal Salman
fd46c4d2be Fix #249 Detect Huawei devices 2017-07-01 18:49:35 +07:00
Faisal Salman
297c6538bc Fix #206 Detect OS for iOS app 2017-06-28 16:12:43 +07:00
Faisal Salman
f9f9fa79e1 Fix #247 Add Oculus Browser 2017-06-28 15:57:50 +07:00
Faisal Salman
07fe58b793 Fix #220 Identify UBrowser as UCBrowser 2017-06-28 14:54:39 +07:00
Faisal Salman
3a4626b5e8 Fix #211 Distinguish Samsung Browser from Android Browser 2017-06-28 14:20:05 +07:00
Faisal Salman
3fd01f07ea Fix #235 Detect Meizu Tablet 2017-06-22 17:37:35 +07:00
Faisal Salman
d103dd5450 Fix #219 samsung mistakenly detected as sony 2017-06-22 17:04:14 +07:00
Faisal Salman
6cc6742f5e increment patch version 2017-06-22 14:20:01 +07:00
Faisal Salman
cf977c50ed remove component.json 2017-06-22 14:11:17 +07:00
Faisal Salman
4c15b10730 revert readme.md fix 2017-06-03 02:28:55 +07:00
Faisal Salman
a3c7619d3a fix readme.md conflict 2017-06-03 01:08:20 +07:00
Faisal Salman
82aba654f9 Merge pull request #242 from ebbmo/feature/recognize_facebook_browser_for_android
Facebook browser now recognized as well (not only iOS)
2017-05-23 14:55:27 +07:00
Hermann Ebert
2f1b14906f Facebook browser now recognized as well (not only iOS) 2017-05-23 09:06:58 +02:00
Faisal Salman
a3a09d33bc Merge pull request #236 from ronkorland/master
Add support for Chrome Headless user agent
2017-05-17 09:49:29 +07:00
Faisal Salman
946ba02c54 Merge pull request #228 from arturom/develop
Added Google Chromemast detection
2017-05-15 00:38:11 +07:00
Faisal Salman
d2d570fcd5 Merge pull request #233 from vladimyr/develop
Adding Opera Coast support, fixing UCBrowser detection
2017-05-15 00:33:38 +07:00
Faisal Salman
18e08428f4 Merge pull request #216 from ericschrenker/0readme
Copyedit Readme File
2017-04-26 11:15:28 +07:00
Ron Korland
552915907e Add support to Chrome Headless user agent 2017-04-13 16:42:04 +03:00
Germán M. Bravo
6984de7927 Fix server side rendering
Fixes problem when window is undefined in the server.
2017-03-30 16:13:41 -06:00
Dario Vladovic
7a68f35574 Adding support for Puffin browser 2017-03-21 18:41:51 +01:00
Dario Vladovic
2bc75f10bc Adding Opera Coast support, fixing UCBrowser detection
- pushing UCBrowser up to avoid being caught by Chrome regex
- adding regex for Opera Coast (Opera's iOS browser)
2017-03-21 18:09:15 +01:00
Nikhil Motiani
2610f37a8b Added Gigaset Tablet detection 2017-03-16 20:39:21 +05:30
Nikhil Motiani
a25bb8b1a6 Added Amazon Kindle Fire Tablet detection 2017-03-16 20:35:11 +05:30
Nikhil Motiani
ee2db31f8c Added Le-Pan Tablet detection 2017-03-16 20:27:04 +05:30
Nikhil Motiani
89775a8ae7 Added NextBook Tablet detection 2017-03-16 20:19:14 +05:30
Nikhil Motiani
7d826ed62e Improved Unidentified Tablet detection 2017-03-16 20:09:22 +05:30
Nikhil Motiani
a6316f02b0 Added Trinity Tablets detection 2017-03-16 20:06:33 +05:30
Nikhil Motiani
72a11e24b2 Added MachSpeed Tablets detection 2017-03-16 20:00:42 +05:30
Nikhil Motiani
f7ca724f3b Added Rotor Tablets detection 2017-03-16 19:56:40 +05:30
Nikhil Motiani
8d826fcc24 Added Envizen Tablets detection 2017-03-16 19:51:44 +05:30
Nikhil Motiani
951106c425 Added LvTel Phones detection 2017-03-16 19:44:21 +05:30
Nikhil Motiani
83ca52bb28 Added Voice Xtreme Phones detection 2017-03-16 19:43:50 +05:30
Nikhil Motiani
6fb4941458 Added Insignia Tablets detection 2017-03-16 15:48:22 +05:30
Nikhil Motiani
48ab3b372c Added Dragon-Touch Tablets detection 2017-03-16 15:45:39 +05:30
Nikhil Motiani
38c409e8d9 Added Zeki Tablets detection 2017-03-16 15:27:35 +05:30
Nikhil Motiani
4e2cbdfd16 Added Swiss Mobiles and Tablets detection 2017-03-16 15:19:22 +05:30
Nikhil Motiani
fbe8a0e3a6 Added Generic Android detection 2017-03-16 15:09:01 +05:30
Nikhil Motiani
8e9c400ec5 Added ZTE K-Series Tablet detection 2017-03-16 15:07:22 +05:30
Nikhil Motiani
b89fa098aa Added NuVision Tablet detection 2017-03-16 15:04:02 +05:30
Nikhil Motiani
f3882f1882 Added Barnes & Noble Tablet detection 2017-03-16 15:03:04 +05:30
Nikhil Motiani
a25426840c Added Dell Venue Tablet detection 2017-03-16 15:01:49 +05:30
Nikhil Motiani
985a7b18e0 Added Verizon Devices detection 2017-03-16 15:00:00 +05:30
Nikhil Motiani
8e09cd49e3 Added RCA Devices detection 2017-03-16 14:57:28 +05:30
Nikhil Motiani
4768992762 Added LG Generic Mobile 2017-03-16 14:54:40 +05:30
Nikhil Motiani
f89e08f2c0 Improved LG Tablet Detection 2017-03-16 14:47:11 +05:30
Arturo Mejia
fe568ffe96 Added Google Chromemast detection 2017-03-08 12:55:35 -05:00
Eric Schrenker
252db2534e 📝 copyedit readme 2017-01-17 14:43:09 -06:00
Faisal Salman
6555bf6e81 Fix #210 Refine browser: QQBrowser 2016-12-27 16:36:51 +07:00
Faisal Salman
740fc93b4b Fix #210 Add device: OPPO 2016-12-27 15:58:58 +07:00
Faisal Salman
eed646f9ce Add Bowser 2016-12-22 23:50:01 +07:00
Faisal Salman
764de40fe0 Merge pull request #205 from piperchester/patch-1
Fix formatting for consistency
2016-12-07 14:35:43 +07:00
Piper Chester
49609c0990 Fix formatting for consistency 2016-12-06 22:16:25 -08:00
Faisal Salman
ef69224d7c Edit readme 2016-12-06 13:47:30 +07:00
Faisal Salman
caa2f47c06 update uglify version 2016-12-06 12:44:16 +07:00
Faisal Salman
5177c460a5 Use constructors 2016-12-06 12:41:48 +07:00
Faisal Salman
3e2d5c1817 Update contributors 2016-11-22 14:03:54 +07:00
Faisal Salman
29a0372611 Merge branch 'master' into develop 2016-11-22 00:52:24 +07:00
Faisal Salman
2aa2f77881 Fix #186 unnecessary if statement inside while loop 2016-11-22 00:49:18 +07:00
Faisal Salman
1e228b2fbe Merge pull request #201 from roberttod/google-pixel
Add google pixel devices
2016-11-18 14:50:13 +07:00
Robert Tod
5379ec8513 Add google pixel devices
- Add Google Pixel and Google Pixel XL mobiles
- Add Google Pixel C tablet
2016-11-17 13:36:08 -05:00
Faisal Salman
01ae611dfa Build dist package 2016-11-14 10:14:01 +07:00
Faisal Salman
2de1f2a75d Remove ComponentJS support 2016-11-14 10:12:49 +07:00
Faisal Salman
975cbdc89e Bumping version: 0.7.11 -> 0.7.12 2016-11-14 10:02:07 +07:00
Faisal Salman
507714c3c7 Move logo to right 2016-11-14 00:42:43 +07:00
Faisal Salman
2b4a20d162 Edit readme 2016-11-14 00:33:56 +07:00
Faisal Salman
34848e8ec2 Fix #187 #171 #92 Require.js 2016-11-11 18:40:26 +07:00
Faisal Salman
97b52b2cfd Test unit for extension 2016-11-11 13:58:15 +07:00
Faisal Salman
9f0419607b Fix #127 galaxy note 2016-11-11 10:40:32 +07:00
Faisal Salman
b13c891d7f Fix #190 haiku 2016-11-11 09:26:59 +07:00
Faisal Salman
7f9919f896 Fix #185 Huawei Nexus 6P 2016-11-10 09:41:16 +07:00
Faisal Salman
9fe7561d78 Fix #96 Moto X 2016-11-10 09:30:04 +07:00
Faisal Salman
b99840d074 Fix #158 xiaomi mi note 2016-11-10 09:24:00 +07:00
Faisal Salman
61b0f1c054 Fix #87 oneplus one 2016-11-10 09:16:17 +07:00
Faisal Salman
58880fda7f Fix #43 #68 xperia sp & asus padfone 2016-11-10 09:11:23 +07:00
Faisal Salman
73735e1ca8 Fix #37 #38 test case for nexus 7 & ipod 2016-11-10 08:57:15 +07:00
Faisal Salman
0f0ea13fab Fix #99 Wrong Windows version 2016-11-10 00:45:48 +07:00
Faisal Salman
1fb82fb6ff Smart-TV ordering 2016-11-10 00:43:20 +07:00
Faisal Salman
88f2f4e24c Fix #32 browser recognized as version 2016-11-10 00:21:28 +07:00
Faisal Salman
1a4dab5829 Edit readme: guide to contribute 2016-11-09 23:41:57 +07:00
Faisal Salman
2467a458e3 Fix #22 #33 #34 #129 Distinguish stock Android Browser from Chrome 2016-11-09 22:37:21 +07:00
Faisal Salman
aadabcce29 Fix #188 Separate Chrome WebView from Chrome 2016-11-09 19:32:20 +07:00
Faisal Salman
d0b7c5892f Samsung smarttv misidentified as mobile 2016-11-09 19:27:41 +07:00
Faisal Salman
d3f959ee28 Split mediaplayer test cases, edit readme 2016-11-09 18:09:11 +07:00
Faisal Salman
d1a33d7d85 Test case for #174 2016-11-08 12:55:56 +07:00
Faisal Salman
3dae55a3c8 Fix #197 microsoft lumia 2016-11-08 12:55:19 +07:00
Faisal Salman
87b88246a2 Merge branch 'master' of github.com:faisalman/ua-parser-js 2016-11-07 21:34:16 +07:00
Faisal Salman
a56c990ec3 Fix #188 distinguish webview from chrome 2016-11-07 21:34:05 +07:00
Faisal Salman
458f3c3cd2 Merge pull request #196 from leventebalogh/patch-1
Fix: don't define the RequireJs module with name
2016-11-07 20:27:24 +07:00
Levente Balogh
f28f87c412 Fix: don't define the RequireJs module with name
If we define it with name it becomes less portable and breaks code that used version `0.7.10`.
This is not correct according to **semver**, as this is a `patch` only which should not break APIs.

I think defining the module with a name should be a responsibility of build tools / optimisation tools.
2016-11-07 10:34:08 +01:00
Faisal Salman
10775bd17c Increment build version to 0.7.11 2016-11-07 00:37:33 +07:00
Faisal Salman
c03a84a601 Add WeChat 2016-11-07 00:28:20 +07:00
Faisal Salman
eade7a9355 Merge pull request #167 from philippsimon/hbbtv
Get SmartTV device by HbbTV part
2016-11-07 00:15:10 +07:00
Faisal Salman
4e0aa0b88b Merge pull request #149 from dhcmrlchtdj/wechat
add support for WeChat
2016-11-07 00:11:25 +07:00
Faisal Salman
4e7c662b0b Merge pull request #173 from sueddeutsche/fix/samsung-device-detection
Add generic device detection for samsung smartphones
2016-11-07 00:02:02 +07:00
Faisal Salman
93993dc311 Merge pull request #181 from WebEngage/hp-10-tablet-device
Add device detection for HP 10 tablet
2016-11-06 23:52:34 +07:00
Faisal Salman
55e75dd1b3 Merge pull request #195 from firmfirm/master
Add HTML imports entry-point
2016-11-04 22:54:47 +07:00
Martynas
c71373b666 Add HTML imports entry-point 2016-11-03 19:50:51 +02:00
Faisal Salman
bf4c2e170e Fix #174: "Tablet PC" != tablet device 2016-10-29 00:39:20 +07:00
Faisal Salman
51b8089958 Merge pull request #191 from kennynaoh/master
Add CDNJS version badge in readme
2016-10-22 06:43:57 +07:00
naoh
550420d725 Add CDNJS version badge in readme
This will add the badge to show its version on CDNJS and also link to its page on CDNJS!
2016-10-18 17:10:36 +08:00
Faisal Salman
fbcfe248b8 Merge pull request #172 from fcamblor/patch-1
Fixed require sample in readme
2016-09-29 19:50:50 +07:00
Faisal Salman
2a5cd4d119 Merge pull request #179 from leipert/patch-1
rewrote license field to be SPDX compatible
2016-09-29 19:49:48 +07:00
Lithin
c3f7294a44 Add device detection for HP 10 tablet 2016-05-26 19:01:11 +05:30
Lukas Eipert
b254f93ec1 rewrote license field to be SPDX compatible
According to [NPM docs](https://docs.npmjs.com/files/package.json#license) the `license` field in package.json should be SPDX compatible.

[SPDX](https://spdx.org/licenses/) is a format which allows you to specify your licenses in an easy understandable, machine parseable way.

These changes reflect your license choice according to #1
2016-05-23 11:33:12 +02:00
Benjamin Urban
1020d10a30 Add generic device detection for samsung smartphones 2016-03-22 15:08:11 +01:00
Frédéric Camblor
5ba9fd50ed Fixed require sample in readme
Module name is `ua-parser-js`, not `ua-parser` (see [here](d929c3e508/src/ua-parser.js (L855)))
2016-03-17 18:03:33 +01:00
philippsimon
bb69ef2bd4 Get SmartTV device by HbbTV part 2016-02-26 18:53:43 +01:00
Faisal Salman
3a457f9bd9 Merge pull request #136 from malash/fix/util-extend
Rewrite util.extend to a clone version
2016-02-25 10:54:54 +07:00
Malash
d929c3e508 Merge branch 'master' into fix/util-extend
* master:
  Meteor fixes
  fix it for opera mini 8 above on iphone
  Add name to UA-Parser
  Fix image #150
  Increment build version: 0.7.10
  Check for tablet first
  Fix #153 mistaken Search phrase for Arch OS
  Seems to fix the issue for specific UA found in #159
  UAParser is exposed globally to the window object. It can be used directly.
  Fix detection of Firefox on iOS.
  Added hasOwnProperty check
  Generalize the check for an unidentifiable mobile or tablet to correctly categorize unidentifiable Android smartphones as "mobile".
  travis update: node_js stable, cache node_modules, sudo false
  Detect Nexus 6 as Motorola only.
  Add Playstation 4 support.
  Added Nexus 6 detection
  Added DEVICE regular expressions for "Samsung galaxy S6" and "Samsung Galaxy S6 Edge" devices + test cases
  Adding PhantomJS (http://phantomjs.org/)
  Add Sleipnir
2016-02-22 15:15:09 +08:00
Faisal Salman
0d42b3a752 Merge pull request #163 from jobrapido/develop
Optimized Android browser regex patterns
2016-02-21 22:47:04 +07:00
Faisal Salman
1ec2119288 Merge pull request #160 from gryphon/master
Add name to UA-Parser RequireJS module
2016-02-21 22:46:56 +07:00
Andrea Vaghi
4344c43d04 run build 2016-01-28 11:05:27 +01:00
Andrea Vaghi
909d6fc26d Optimized pattern for Android browser, moved them before the Chrome pattern to avoid errors in the some of the newest browsers 2016-01-28 11:01:05 +01:00
Faisal Salman
8e46a85549 Merge pull request #162 from cesarve77/patch-1
Meteor fixes
2016-01-07 09:11:13 +07:00
Faisal Salman
1f92d6148c Merge pull request #161 from yupmin/opera-mini-8-above-iphone
fix it for opera mini 8 above on iphone
2016-01-07 09:10:02 +07:00
CESAR RAMOS
5d57850074 Meteor fixes 2016-01-03 21:23:20 -04:30
Yun Young-jin
8e81811dea fix it for opera mini 8 above on iphone
https://dev.opera.com/blog/opera-mini-8-for-ios/
2015-12-30 12:00:33 +09:00
Grigory Dmitrenko
99a80e88fb Add name to UA-Parser 2015-12-23 14:10:37 +03:00
Faisal Salman
cbba2f5728 Fix image #150 2015-12-12 18:26:40 +07:00
Faisal Salman
fd39be3336 Increment build version: 0.7.10 2015-12-12 17:44:29 +07:00
Faisal Salman
a1293f804e merge develop 2015-12-12 17:40:57 +07:00
Faisal Salman
cf5c1f9e01 Check for tablet first 2015-12-12 17:34:00 +07:00
Faisal Salman
5d3835ad00 Merge pull request #154 from szchenghuang/meteor-export
UAParser is exposed globally to the window object. It can be used directly.
2015-12-12 15:43:09 +07:00
Faisal Salman
09bf4ecf7f Fix #153 mistaken Search phrase for Arch OS 2015-12-12 15:23:11 +07:00
Faisal Salman
43b0ee79d6 Seems to fix the issue for specific UA found in #159 2015-12-12 14:43:16 +07:00
Faisal Salman
9518833e83 Add PhantomJS fix #157 2015-12-12 14:28:39 +07:00
Faisal Salman
1e58e884ef Add PhantomJS support fix #157 2015-12-12 13:39:45 +07:00
szchenghuang
e230cc1920 UAParser is exposed globally to the window object. It can be used directly. 2015-11-20 15:30:28 +08:00
Faisal Salman
bbd3f14cfb Merge pull request #151 from 0x7f/firefox-ios
Fix detection of Firefox on iOS.
2015-11-19 21:38:06 +07:00
Faisal Salman
a66d9b238a Merge pull request #145 from lquinn/general-android-mobile
Treat all Android smartphones as mobile
2015-11-18 23:00:18 +07:00
Maximilian Haupt
ae5bfb3893 Fix detection of Firefox on iOS.
Firefox on iOS' ua string is also matched by the "Safari < 3.0" regular
expression, unfortunately. Reorder the regular expressions so that the
one for FxiOS matches first.
2015-11-13 12:09:32 +01:00
niris
2e5dff95c8 add support for wechat 2015-11-03 16:05:37 +08:00
Faisal Salman
e944fededb Merge pull request #148 from shanebo/master
Added hasOwnProperty check in result object for in
2015-11-02 09:39:34 +07:00
Shane Thacker
23160c9fb3 Added hasOwnProperty check
This ensures that the result output is clean of extended type methods
2015-11-01 12:34:54 -06:00
Liam Quinn
01ba36c94d Generalize the check for an unidentifiable mobile or tablet to correctly
categorize unidentifiable Android smartphones as "mobile".
2015-10-29 10:24:44 -04:00
Faisal Salman
99c15dee95 Merge pull request #144 from duzun/master
travis update: node_js stable, cache node_modules, sudo false
2015-10-28 06:25:55 +07:00
Dumitru Uzun
e8bec7e611 travis update: node_js stable, cache node_modules, sudo false 2015-10-22 09:30:52 +03:00
Faisal Salman
f670224d8e Merge pull request #140 from 0x7f/playstation4
Add Playstation 4 support.
2015-10-17 05:31:21 +07:00
Faisal Salman
116b5c695d Merge pull request #141 from 0x7f/fix-nexus-6
Detect Nexus 6 as Motorola only.
2015-10-17 05:31:00 +07:00
Maximilian Haupt
0aafba67fa Detect Nexus 6 as Motorola only.
The commit 3964971c3 added Nexus 6 to LG and Motorola, but it should be
Motorola only, as stated in the according commit message anyways.
2015-10-16 15:01:57 +00:00
Maximilian Haupt
ab6a56d931 Add Playstation 4 support. 2015-10-16 14:14:56 +00:00
Faisal Salman
3bff4cf037 Merge pull request #133 from URXtech/nexus-6
Added Nexus 6 detection
2015-10-13 22:02:42 +07:00
Malash
792dc0246a Rewrite util.extend to a clone version 2015-10-10 15:53:17 +08:00
Aamir Poonawalla
3964971c38 Added Nexus 6 detection
Correctly identifies a Nexus 6 device as being a Motorola mobile device.
2015-09-21 13:34:56 -07:00
Faisal Salman
3382b75cad Merge pull request #131 from pieterhendrickx/develop
Added DEVICE regular expressions for "Samsung galaxy S6" and "Samsung…
2015-08-20 20:59:59 +07:00
Pieter Hendrickx
a19c6be712 Added DEVICE regular expressions for "Samsung galaxy S6" and "Samsung Galaxy S6 Edge" devices + test cases 2015-08-20 09:00:16 +02:00
Faisal Salman
20ea67ed1d Merge pull request #130 from malash/ucbrowser
fix support for UCBrowser
2015-08-05 23:36:30 +07:00
Malash
172d63a28f fix support for UCBrowser 2015-08-05 19:47:48 +08:00
Faisal Salman
992e829643 Verup 0.7.9 2015-07-19 04:00:01 +07:00
Faisal Salman
e9e5467add Readme: flattr button, nodejs example, drop browser.major 2015-07-19 03:49:39 +07:00
Faisal Salman
d3a2e1750b Merge branch 'master' of github.com:faisalman/ua-parser-js 2015-07-19 02:22:22 +07:00
Faisal Salman
29d75c994e Merge pull request #124 from longsleep/iridium-detection
Added detection for Iridium Browser.
2015-07-19 02:23:38 +07:00
Faisal Salman
7e23d53e4b Merge branch 'master' of github.com:faisalman/ua-parser-js 2015-07-19 02:03:50 +07:00
Simon Eisenmann
892476f544 Added detection for Iridium Browser. 2015-07-17 16:10:59 +02:00
Faisal Salman
a165e152de Merge pull request #119 from roberttod/patch-1
Reference window as global if available
2015-07-04 01:39:19 +07:00
Faisal Salman
ab64c21a80 Merge pull request #120 from demis-palma/patch-4
palm os regexp fixed
2015-07-04 01:39:14 +07:00
Faisal Salman
5da2305369 Merge pull request #121 from duzun/verup
verup.js installed over NPM -> devDependencies
2015-07-04 01:39:10 +07:00
Faisal Salman
8e169098b5 Merge pull request #122 from divdavem/phantomjs
Adding PhantomJS (http://phantomjs.org/)
2015-07-04 01:39:06 +07:00
ddivernois
aa1bf53337 Adding PhantomJS (http://phantomjs.org/) 2015-07-01 11:23:56 +02:00
Dumitru Uzun
1b957cad1a verup.js installed over NPM -> devDependencies 2015-06-19 01:50:06 +03:00
Demis Palma
8d9cd21331 palm os regexp fixed
The regexp won't work as expected because the meta-character \o doesn't make sense.
Replaced with \s which indicates "whitespace character"
2015-06-18 23:32:15 +01:00
Robert Tod
f117f600ba Reference window as global if available
This change will use `window` by default if it exists so that `browserify` and `Webpack` builds do not need to do something like

```javascript
var parser = new UAParser(window.navigator.userAgent)
```

https://github.com/faisalman/ua-parser-js/issues/84
2015-06-10 17:35:16 +01:00
Faisal Salman
22e17fb004 Add Sleipnir 2015-05-11 23:44:34 +07:00
Faisal Salman
978ee5a4da Add Firefox for iOS 2015-05-11 23:33:57 +07:00
Faisal Salman
a3e4fbe5bb Merge pull request #116 from nikrolls/patch-1
Added Edge and EdgeHTML to documentation
2015-05-10 12:14:13 +07:00
Faisal Salman
9dacf37e4a Merge pull request #112 from duzun/master
Updated verup to v1.2.0 and moved its config to package.json
2015-05-10 12:13:46 +07:00
Nik Rolls
4d99bc0777 Added Edge and EdgeHTML to documentation 2015-05-10 15:33:36 +12:00
Faisal Salman
f558e657bb Merge pull request #113 from nikrolls/correct-ms-edge-detection
Microsoft Edge is not IE12
2015-05-08 20:15:13 +07:00
Nik Rolls
4203f8144f Microsoft Edge is not IE12 2015-05-08 18:02:05 +12:00
Faisal Salman
21a525f442 Add layout engine: EdgeHTML 2015-05-07 04:59:01 +07:00
Faisal Salman
3abf465aec changing build flow 2015-05-07 04:21:43 +07:00
Dumitru Uzun
56c90d2134 updated verup script 2015-05-05 20:39:23 +03:00
Dumitru Uzun
dc6bae6aae Updated verup to v1.2.0 and moved its config to package.json 2015-04-30 17:58:30 +03:00
Faisal Salman
1fa7137f1f Fix #111 2015-04-29 11:29:54 +07:00
Faisal Salman
378a298fee Merge pull request #110 from duzun/master
Added a script to bump version in project files. Fix #107
2015-04-28 13:39:17 +07:00
Dumitru Uzun
32db7bfb97 verup adds \n at the end of JSON files 2015-04-20 14:24:20 +03:00
Dumitru Uzun
d1a18c6ff1 Added script to bump version. Eg: npm run verup -- 1.0 2015-04-20 14:19:37 +03:00
Faisal Salman
4887793ee0 Merge pull request #108 from mollases/master
Adding Windows 10 IE 12 to ua-parser (w/ test)
2015-04-19 13:56:17 +07:00
Faisal Salman
b616d0b3d1 Merge pull request #106 from duzun/master
updated email of Dumitru Uzun in package.json
2015-04-19 13:56:09 +07:00
Admas
c7749b3a2a Adding WIndows 10 IE regex
IE 12 for windows 10 uses gets caught as chrome:
https://msdn.microsoft.com/en-us/library/ie/hh869301%28v=vs.85%29.aspx

Now we search for Edge and mark it as IE
2015-04-17 09:23:28 -07:00
Admas
b00b2a7bcf Adding WIndows 10 IE test 2015-04-17 09:21:11 -07:00
Dumitru Uzun
ca4e8ce2e6 update email of Dumitru Uzun; merged from faisalman 2015-04-17 17:33:30 +03:00
Faisal Salman
3d2d8d5d84 Fix jshint eror 2015-04-15 01:39:21 +07:00
Faisal Salman
cce9dc1474 Add meteor support 2015-04-07 02:40:50 +07:00
Faisal Salman
fa6f8de25f Increment patch version to 0.7.4 2015-04-07 01:41:46 +07:00
Faisal Salman
6a284e2670 Temporarily comment device models to be moved soon 2015-04-07 01:37:14 +07:00
Faisal Salman
ad2613d8e9 Create package.js for meteor package 2015-04-07 01:19:14 +07:00
Faisal Salman
866bdc27af Windows 10 test 2015-03-29 10:02:39 +07:00
Faisal Salman
a5cb2d8821 Fix #100: Detect NT 10.0 as Windows 10 2015-03-29 09:57:34 +07:00
Faisal Salman
fe133e4228 Merge pull request #102 from demis-palma/patch-3
Unneeded comma
2015-03-10 22:48:42 +07:00
Faisal Salman
357ea1b42f Merge pull request #101 from demis-palma/patch-1
Character class may not be used inside character range
2015-03-10 22:47:34 +07:00
Demis Palma
89a3a21ce3 Unneeded comma
Removed last comma in array literal
2015-02-27 17:57:27 +00:00
Demis Palma
3c911f2dd4 Character class may not be used inside character range
Additional information and examples at http://stackoverflow.com/questions/15321938/regex-character-class-inside-character-range-failing-intellijs-jslint-inspectio
2015-02-27 17:42:20 +00:00
Faisal Salman
69c688810d Merge from @algenon 2015-02-27 11:55:52 +07:00
Faisal Salman
6b2571eaa3 Merge pull request #94 from d1o/develop
Added Xperia Z, Galaxy, Oppo, Advan, i-mobile
2015-02-27 10:43:57 +07:00
otakuSiD
5dcc4db665 Get rid of duplicate Xiaomi detection 2015-02-26 15:19:09 +02:00
Dmitry Tyschenko
af9fc69161 Added Facebook application browser 2015-02-05 12:31:47 +02:00
Anton Zhiyanov
feed5498eb Refactor Xiaomi regexps 2015-02-02 19:54:46 +03:00
Anton Zhiyanov
2e87b02dda Add Vivaldi browser 2015-02-02 19:53:29 +03:00
Dmitry Tyschenko
f6b22d6654 Added Xperia Z, Galaxy, Oppo, Advan, i-mobile 2015-01-30 11:17:01 +02:00
Faisal Salman
354d29c2b6 Merge pull request #93 from austinpray/master
fixes typeof
2015-01-29 13:05:51 +07:00
Faisal Salman
6402ac67b9 Merge pull request #91 from algenon/develop
Android Browser and Xiaomi devices detection
2015-01-29 13:05:36 +07:00
Austin Pray
7cae802f3c fixes typeof 2015-01-28 13:01:03 -06:00
algenon
5c25229616 Add Android and MIUI Browser to description 2015-01-25 18:26:43 +03:00
algenon
9d383c5395 Add Xiaomi devices 2015-01-25 17:54:39 +03:00
algenon
1eeb1face1 Add Android Browser and Xiaomi MIUI Browser 2015-01-25 17:39:15 +03:00
Faisal Salman
c3ddbe27ae Merge pull request #88 from soundrop/develop
Better detection of Sony Xperia devices
2015-01-10 18:53:46 +07:00
Dumitru Uzun
073b551b90 Merge branch 'master' of https://github.com/faisalman/ua-parser-js 2014-12-27 00:32:02 +02:00
Sylvain Gizard
7d5e50f008 Remove duplication 2014-12-18 16:26:38 +01:00
Sylvain Gizard
294fae589d Remove duplicated test 2014-12-18 16:09:51 +01:00
Sylvain Gizard
d47e1a5e8e Update build 2014-12-18 16:04:31 +01:00
Sylvain Gizard
50c4e3e551 Trailing whitespace 2014-12-18 16:04:24 +01:00
Sylvain Gizard
5002ea0846 Rough detection of Sony Xperia phones and tablets 2014-12-18 16:04:08 +01:00
Faisal Salman
bc4561b1c1 Merge pull request #86 from sgautrea/nexus-9
Adding HTC Nexus 9 recognition
2014-12-03 15:30:16 +07:00
Shane Gautreau
083db7b7d2 Adding test for Nexus 9 recognition 2014-12-02 16:46:04 -05:00
sgautrea
744c9bf0bd Update ua-parser.js
Adding regex for Nexus 9 tablet
2014-12-02 16:08:47 -05:00
Dumitru Uzun
27c17736c2 Closure Compiled 2014-11-20 12:41:15 +02:00
Faisal Salman
4d3656bb9c Merge pull request #81 from duzun/patch-2
Keep global scope clean with AMD. Always check for jQuery global.
2014-11-20 17:40:52 +07:00
Dumitru Uzun
551fbf100c Keep global scope clean with AMD. Always check for jQuery global.
If an AMD environment, don't export `UAParser` to global scope.
Even in AMD environment jQuery exports to global scope. We should catch it even then.
It also can happen then one joins the jQuery source file with other jQuery plugins in a CommonJS env.
2014-11-20 12:32:31 +02:00
Faisal Salman
e725633328 Fix #24 #80 2014-11-20 07:15:18 +07:00
Faisal Salman
d5cf025713 Merge pull request #79 from hmvs/patch-3
Moto X, G, Razr Mobile detection
2014-11-20 07:07:26 +07:00
Vadim Kurachevsky
9256ed4186 Moto X, G, Razr Mobile detection
Moto RAZR: 
Mozilla/5.0 (Linux; Android 4.0.4; XT910 Build/6.7.2-180_SPU-19-TA-11.6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.135 Mobile Safari/537.36
Moto X:
Mozilla/5.0 (Linux; U; Android 4.2; xx-xx; XT1058 Build/13.9.0Q2.X-70-GHOST-ATT_LE-2) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30
Moto G:
Mozilla/5.0 (Linux; Android 4.4.2; XT1033 Build/KXB20.25-1.31) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.136 Mobile Safari/537.36
2014-11-19 10:38:48 +02:00
Faisal Salman
70d629ca71 Extract major from version instead of directly using regex 2014-11-10 18:43:04 +07:00
Faisal Salman
0951cebd09 Update patch version to 0.7.3 2014-11-09 21:08:48 +07:00
Faisal Salman
0a2b05c6fd Fix #77: Standardize OS name for Mac OS 2014-11-08 09:55:26 +07:00
Faisal Salman
9e81f03558 Merge branch 'master' of github.com:faisalman/ua-parser-js 2014-11-07 21:51:41 +07:00
Faisal Salman
a04d2c0efc Merge from develop branch 2014-11-07 17:11:31 +07:00
Faisal Salman
152377b390 Add Windows 10 2014-11-07 16:57:52 +07:00
Faisal Salman
d3f1b0eaf7 Increment patch version to 0.7.2 2014-11-07 15:32:38 +07:00
Faisal Salman
a78d3f7d4b Keep license comment when minifying 2014-11-07 15:20:44 +07:00
Faisal Salman
b0ed222114 Fix #54: update mocha version to 1.8.0 2014-11-07 14:56:31 +07:00
Faisal Salman
8c813e15b3 Drop test on 0.8 2014-11-07 14:53:16 +07:00
Faisal Salman
e6c2296d86 Update readme.md 2014-11-07 14:50:10 +07:00
Faisal Salman
577ded5272 Move minified script under /dist directory 2014-11-04 18:09:39 +07:00
Faisal Salman
a455d7be0d Add OS: VectorLinux 2014-10-31 07:04:22 +07:00
Faisal Salman
4222c6c1e0 Add new devices: Pebble & Google Glass 2014-10-26 01:40:55 +07:00
Faisal Salman
2be03bf30c New categories for device: wearable & embedded 2014-10-26 01:33:07 +07:00
Faisal Salman
6c1c202815 Rearranging things 2014-10-26 01:30:39 +07:00
Faisal Salman
d3a0e23945 Add OS: Contiki, Mageia, Linpus, Solaris, OpenVMS 2014-10-24 04:23:40 +07:00
Faisal Salman
6bb2e23924 Add CPU architecture: ARM64, AVR 2014-10-22 01:03:16 +07:00
Faisal Salman
4e41b6e1d0 Change for loop into while 2014-10-22 00:17:51 +07:00
Faisal Salman
b2f54a6b24 Merge pull request #73 from PeterDaveHello/patch-2
Use svg instead of png to get better image quality
2014-10-20 23:59:55 +07:00
Peter Dave Hello
39168a321c Use svg instead of png to get better image quality 2014-10-20 20:51:19 +08:00
Faisal Salman
1cd7427e90 Add new devices: Microsoft Kin, Archos Gamepad, Nvidia Shield, Samsung SmartTV, Sharp Aquos 2014-10-20 01:19:06 +07:00
Faisal Salman
02122f0002 Add new devices: Xbox, Ouya 2014-10-20 00:17:12 +07:00
Faisal Salman
9fe282ed41 Merge remote master branch 2014-10-16 20:01:21 +07:00
Faisal Salman
4617899224 Merge pull request #71 from boneyao/china
ucbrowser qqbrowser
2014-10-15 20:19:22 +07:00
Faisal Salman
cf0ec0f143 Remove KTAs(?) 2014-10-15 11:32:29 +07:00
Faisal Salman
2d885aef26 Increment patch version to 0.7.1 2014-10-15 07:09:25 +07:00
Faisal Salman
851a15d86b Update readme 2014-10-15 00:25:10 +07:00
Faisal Salman
90c85f59f1 User defined regexes first 2014-10-14 23:58:19 +07:00
Faisal Salman
87b7f809c5 Fix #66 2014-10-14 23:40:05 +07:00
Faisal Salman
5d817e372b Hide media players 2014-10-14 23:25:48 +07:00
Faisal Salman
381bbea845 Move extend function inside util 2014-10-14 23:06:59 +07:00
Faisal Salman
309ec34951 Merge branch 'develop' of github.com:faisalman/ua-parser-js into develop 2014-10-14 22:29:28 +07:00
boneyao
fdf865a86f change version 2014-10-14 16:57:57 +08:00
boneyao
af60b4f1a8 ucbrowser qqbrowser 2014-10-14 16:47:10 +08:00
Faisal Salman
8d1791a88b Merge pull request #70 from maurermax/develop
Extending regex when instantiating object
2014-10-07 09:51:19 +07:00
Max Maurer
7e5a6dd262 added myself to the contributors 2014-10-06 17:39:29 +02:00
Max Maurer
d4229ed33b extended to be able to pass in own regexes 2014-10-06 17:30:52 +02:00
Faisal Salman
a7e53ade39 Merge pull request #61 from captainclam/master
Samsung Tablets
2014-10-03 20:55:43 +07:00
Simon Lang
2319649002 include SM-T within Samsung tablet model field. add 2 more tests. 2014-08-25 13:30:18 +10:00
Simon Lang
2b4f19970e test for Samsung SM-T231 2014-08-25 12:36:08 +10:00
Faisal Salman
3fc24a6d7a Merge pull request #60 from hhelwich/master
Fix hyphens in regexp character classes
2014-08-23 22:00:00 +07:00
Hendrik Helwich
6f91063634 Fix hyphens in regexp character classes 2014-08-21 15:59:37 +02:00
Simon Lang
cd3c3e7d2a Samsung Tablets (untested)
e.g. "Mozilla/5.0 (Linux; Android 4.4.2; SM-T700 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.517 Safari/537.36"
2014-08-15 13:01:19 +10:00
Faisal Salman
36de46956b Add Amazon Fire Phone 2014-08-14 08:34:02 +07:00
Faisal Salman
3510f83b4c Add Series40 2014-08-14 08:08:29 +07:00
Faisal Salman
31187b1be1 Merge pull request #58 from CCVonLewin/master
Added Samsung Galaxy Note III
2014-08-14 07:53:17 +07:00
Carl C Von Lewin
6375492be3 Added Samsung Galaxy Note III
Added Samsung Galaxy Note III - phablet to "Samsung mobile" expression. User agent strings; http://www.webapps-online.com/online-tools/user-agent-strings/dv/brand125499/samsung-galaxy-note-iii
2014-08-13 12:44:26 -04:00
Faisal Salman
77e518befb Fix issue #20 2014-08-06 00:19:38 +07:00
Faisal Salman
c6501015b5 Fix issue #42 2014-08-05 23:55:20 +07:00
Faisal Salman
2b96f9b297 Merge pull request #56 from duzun/patch-1
Added Zepto support (aka jQuery)
2014-08-01 02:14:14 +07:00
Dumitru Uzun
86387a2a39 Added Zepto support (aka jQuery)
Added Zepto support (aka jQuery)

http://zeptojs.com/
2014-07-30 20:41:23 +03:00
Faisal Salman
7860d09c79 Added Sailfish, Jolla, Polytron 2014-07-29 02:57:43 +07:00
Faisal Salman
b60ed8c0c6 Merge pull request #55 from otakusid/master
Added Lenovo S5000 and S6000
2014-07-25 23:53:25 +07:00
otakuSiD
3afb471c74 Added Lenovo S5000 and S6000 2014-07-25 18:23:17 +03:00
Faisal Salman
eec75b2cef Merge pull request #53 from banzai-inc/master
Fix trailing comma errors for Google Closure
2014-07-22 12:06:55 +07:00
Kendall Buchanan
bf315c4a08 Fix trailing comma errors for Google Closure 2014-07-21 12:02:49 -06:00
Faisal Salman
ec68ecee4a Increment minor version 2014-06-25 14:15:17 +07:00
23 changed files with 3105 additions and 1272 deletions

12
.gitignore vendored
View File

@@ -1,12 +1,18 @@
node_modules/
npm-debug.log
<<<<<<< HEAD
### vim ###
.*.s[a-w][a-z]
*.un~
Session.vim
.netrwhist
*~
.versions
### editors ###
.vscode
.idea
*.sublime-*
### OSX ###
.DS_Store
@@ -14,13 +20,9 @@ Session.vim
.LSOverride
Icon
# Thumbnails
._*
# Files that might appear on external disk
.Spotlight-V100
.Trashes
=======
.idea
>>>>>>> baf4bb99b4ef92c71419931e8fd334e34c051e52

1
.npmrc Normal file
View File

@@ -0,0 +1 @@
package-lock=false

View File

@@ -1,6 +1,13 @@
language: node_js
node_js:
- 0.8
- 0.6
- stable
- lts/*
notifications:
email: false
cache:
directories:
- node_modules
sudo: false

View File

@@ -1,26 +1,17 @@
{
"name": "ua-parser-js",
"version": "0.6.3-ktb",
"authors": [
"Faisal Salman <fyzlman@gmail.com>"
],
"private": false,
"main": "src/ua-parser.js",
"ignore": [
"build",
"node_modules",
"bower_components",
"test",
"tests"
],
"contributors": [
"Faisal Salman <fyzlman@gmail.com>",
"Christopher De Cairos <chris.decairos@gmail.com>",
"John Tantalo <john.tantalo@gmail.com>",
"Jon Buckley <jon@jbuckley.ca>",
"Lee Treveil <leetreveil@gmail.com>"
],
"dependencies": {
}
"name": "ua-parser-js",
"version": "0.7.19",
"authors": [
"Faisal Salman <fyzlman@gmail.com>"
],
"private": false,
"main": "src/ua-parser.js",
"ignore": [
"build",
"node_modules",
"bower_components",
"test",
"tests"
],
"dependencies": {}
}

View File

@@ -1,37 +0,0 @@
#!/bin/bash
# dependencies
JSHINT_DIR="node_modules/jshint/bin/jshint"
MOCHA_DIR="node_modules/mocha/bin/mocha"
UGLIFY_DIR="node_modules/uglify-js/bin/uglifyjs"
# check module directory & install if not found
function check_module {
if ! type $2 &> /dev/null
then
echo "$2 is not found"
if ! type "npm" &> /dev/null
then
echo "npm is not installed"
echo "Exiting"
exit 1
else
echo "Installing $1..."
npm install $1
fi
fi
}
check_module "jshint" $JSHINT_DIR
check_module "mocha" $MOCHA_DIR
check_module "uglify-js" $UGLIFY_DIR
echo "Verifiying code..."
$JSHINT_DIR src/ua-parser.js
echo "Running test..."
$MOCHA_DIR -R nyan test/test.js
echo "Minifying script..."
$UGLIFY_DIR src/ua-parser.js > src/ua-parser.min.js
echo "OK"

View File

@@ -1,14 +0,0 @@
{
"name": "ua-parser-js",
"version": "0.6.16",
"description": "Lightweight JavaScript-based user-agent string parser",
"keywords": ["user-agent", "parser", "browser", "engine", "os", "device", "cpu"],
"scripts": ["src/ua-parser.js"],
"main": "src/ua-parser.js",
"license": "MIT",
"development": {
"jshint/jshint": "*",
"visionmedia/mocha": "*",
"mishoo/uglifyjs2": "*"
}
}

1
dist/ua-parser.html vendored Normal file
View File

@@ -0,0 +1 @@
<script src="./ua-parser.min.js"></script>

9
dist/ua-parser.min.js vendored Normal file

File diff suppressed because one or more lines are too long

9
dist/ua-parser.pack.js vendored Normal file

File diff suppressed because one or more lines are too long

21
license.md Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2012-2018 Faisal Salman <<f@faisalman.com>>
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 the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

12
package.js Normal file
View File

@@ -0,0 +1,12 @@
Package.describe({
name: 'faisalman:ua-parser-js',
version: '0.7.19',
summary: 'Lightweight JavaScript-based user-agent string parser',
git: 'https://github.com/faisalman/ua-parser-js.git',
documentation: 'readme.md'
});
Package.onUse(function (api) {
api.addFiles("src/ua-parser.js");
api.export("UAParser");
});

View File

@@ -1,8 +1,8 @@
{
"title": "UAParser.js",
"name": "ua-parser-js",
"version": "0.6.16",
"author": "Faisal Salman <fyzlman@gmail.com> (http://faisalman.com)",
"version": "0.7.19",
"author": "Faisal Salman <f@faisalman.com> (http://faisalman.com)",
"description": "Lightweight JavaScript-based user-agent string parser",
"keywords": [
"user-agent",
@@ -11,44 +11,130 @@
"engine",
"os",
"device",
"cpu"
"cpu",
"jquery-plugin",
"ecosystem:jquery"
],
"homepage": "http://github.com/faisalman/ua-parser-js",
"contributors": [
"Faisal Salman <fyzlman@gmail.com>",
"Aamir Poonawalla <aamir@urx.com>",
"Admas <mollases@users.noreply.github.com>",
"algenon <m@antonz.ru>",
"Alvin Portillo <portilloalvin@gmail.com>",
"Andrea Vaghi <andrea.vaghi@jobrapido.com>",
"Anton Zhiyanov <m@antonz.ru>",
"Arturo Mejia <amejia@blim.com>",
"Arun Rama Reddy <arunramareddy@gmail.com>",
"Austin Pray <austin@austinpray.com>",
"Benjamin Bertrand <bertrand.design@gmail.com>",
"Benjamin Urban <benjamin.urban@sueddeutsche.de>",
"boneyao <admin@boneyao.com>",
"Carl C Von Lewin <carlchristianlewin@gmail.com>",
"CESAR RAMOS <c@imagenproactiva.com>",
"Christopher De Cairos <chris.decairos@gmail.com>",
"Dario Vladovic <d.vladimyr@gmail.com>",
"Davit Barbakadze <jayarjo@gmail.com>",
"ddivernois <david-emmanuel.divernois@amadeus.com>",
"Demis Palma <demis.palma@gmail.com>",
"dhoko <aurelien@protonmail.com>",
"dianhe <dianhe@webank.com>",
"Dmitry Tyschenko <dtyschenko@gmail.com>",
"Douglas Li <doug@knotch.it>",
"Dumitru Uzun <contact@duzun.me>",
"Eric Schrenker <eric.schrenker@gmail.com>",
"Erik Hesselink <hesselink@gmail.com>",
"Fabian Becker <halfdan@xnorfz.de>",
"Faisal Salman <fyzlman@gmail.com>",
"Frédéric Camblor <fcamblor@gmail.com>",
"Germán M. Bravo <german.mb@gmail.com>",
"Grigory Dmitrenko <grigory@snsk.ru>",
"Hendrik Helwich <h.helwich@iplabs.de>",
"Hermann Ebert <ebbmo@HE.local>",
"jackpoll <jackpoll123456@gmail.com>",
"Jake Mc <startswithaj@users.noreply.github.com>",
"John Tantalo <john.tantalo@gmail.com>",
"John Yanarella <jmy@codecatalyst.com>",
"Jon Buckley <jon@jbuckley.ca>",
"Lee Treveil <leetreveil@gmail.com>"
"Kendall Buchanan <kendall@kendagriff.com>",
"Lee Treveil <leetreveil@gmail.com>",
"leonardo <leofiore@libero.it>",
"Levente Balogh <balogh.levente.hu@gmail.com>",
"Liam Quinn <lquinn@blackberry.com>",
"Lithin <lithin@webklipper.com>",
"Loris Guignard <loris.guignard@gmail.com>",
"Lukas Drgon <lukas.drgon@gmail.com>",
"Lukas Eipert <leipert@users.noreply.github.com>",
"Malash <i@malash.me>",
"Martynas <martynas@firmfirm.co>",
"Matt Brophy <matt@brophy.org>",
"Max Maurer <maxemanuel.maurer@gmail.com>",
"Maximilian Haupt <mail@maximilianhaupt.com>",
"Michael Hess <mhess@connectify.me>",
"naoh <naoh.cs03g@nctu.edu.tw>",
"Nik Rolls <nik@rolls.cc>",
"Nikhil Motiani <nikhil.m@247-inc.com>",
"niris <nirisix@gmail.com>",
"Nobuo Okada <nookada@yahoo-corp.jp>",
"otakuSiD <otakusid@gmail.com>",
"Peter Dave Hello <PeterDaveHello@users.noreply.github.com>",
"philippsimon <github@philippsimon.de>",
"Pieter Hendrickx <pieter.hendrickx@belfius.be>",
"Piper Chester <piperchester@gmail.com>",
"Robert Tod <robert@qubit.com>",
"Ron Korland <ron@testim.io>",
"Ross Noble <rosshnoble@gmail.com>",
"Sandro Sonntag <sandro.sonntag@adorsys.de>",
"sgautrea <shanegautreau@gmail.com>",
"Shane Gautreau <sgautrea@opentext.com>",
"Shane Thacker <shane@steadymade.com>",
"shchotse <topal@mail.ua>",
"Simon Eisenmann <simon@longsleep.org>",
"Simon Lang <me@simonlang.org>",
"Stiekel <histkc@gmail.com>",
"Sylvain Gizard <sylvain.gizard@gmail.com>",
"szchenghuang <szchenghuang@gmail.com>",
"Vadim Kurachevsky <vadim@hmvs.org>",
"Yun Young-jin <yupmin@yupmin-office-macmini.local>"
],
"main": "src/ua-parser.js",
"scripts": {
"test": "./build/build.sh"
"build": "uglifyjs src/ua-parser.js -o dist/ua-parser.min.js --comments '/UAParser\\.js/' && uglifyjs src/ua-parser.js -o dist/ua-parser.pack.js --comments '/UAParser\\.js/' --compress --mangle",
"test": "jshint src/ua-parser.js && mocha -R nyan test/test.js",
"verup": "node ./node_modules/verup",
"version": "node ./node_modules/verup 0"
},
"verup": {
"files": [
"bower.json",
"package.js",
"src/ua-parser.js"
],
"regs": [
"^((?:\\$|(\\s*\\*\\s*@)|(\\s*(?:var|,)?\\s+))(?:LIBVERSION|version)[\\s\\:='\"]+)([0-9]+(?:\\.[0-9]+){2,2})",
"^(\\s?\\*.*v)([0-9]+(?:\\.[0-9]+){2,2})"
]
},
"devDependencies": {
"jshint": "~1.1.0",
"mocha": "~1.7.1",
"uglify-js": "~1.3.4"
"mocha": "~1.8.0",
"requirejs": "^2.3.2",
"uglify-js": "~2.7.5",
"verup": "^1.3.x"
},
"repository" : {
"repository": {
"type": "git",
"url": "https://github.com/faisalman/ua-parser-js.git"
},
"licenses": [
{
"type": "GPLv2",
"url": "http://www.gnu.org/licenses/gpl-2.0.html"
},
{
"type": "MIT",
"url": "http://www.opensource.org/licenses/mit-license.php"
}
],
"license": "(GPL-2.0 OR MIT)",
"engines": {
"node": "*"
},
"directories": {
"lib": "src",
"dist": "dist",
"src": "src",
"test": "test"
}
},
"bugs": "https://github.com/faisalman/ua-parser-js/issues",
"demo": "https://faisalman.github.io/ua-parser-js",
"download": "https://raw.github.com/faisalman/ua-parser-js/master/dist/ua-parser.min.js"
}

235
readme.md
View File

@@ -1,49 +1,61 @@
# UAParser.js
Lightweight JavaScript-based User-Agent string parser. Supports browser & node.js environment. Also available as Component package, Bower package, jQuery.ua, & AMD module
<img align="right" src="https://raw.githubusercontent.com/faisalman/ua-parser-js/gh-pages/images/logo.png"> A JavaScript-based User-Agent string parser. Can be used either in browser (client-side) or in node.js (server-side) environment. Also available as jQuery/Zepto plugin, Bower/Meteor package, & RequireJS/AMD module. This library aims to identify detailed type of web browser, layout engine, operating system, cpu architecture, and device type/model, entirely from user-agent string with a relatively small footprint (~17KB when minified / ~6KB gzipped). Written in vanilla JavaScript, which means it doesn't require any other library and can be used independently. However, it's not recommended to use this library as browser detection since the result may not be more accurate than using feature detection.
[![Build Status](https://travis-ci.org/faisalman/ua-parser-js.png?branch=master)](https://travis-ci.org/faisalman/ua-parser-js)
[![Build Status](https://travis-ci.org/faisalman/ua-parser-js.svg?branch=master)](https://travis-ci.org/faisalman/ua-parser-js)
[![NPM downloads](https://img.shields.io/npm/dw/ua-parser-js.svg)](https://www.npmjs.com/package/ua-parser-js)
[![NPM](https://img.shields.io/npm/v/ua-parser-js.svg)](https://www.npmjs.com/package/ua-parser-js)
[![Bower](https://img.shields.io/bower/v/ua-parser-js.svg)](https://bower.io/)
[![CDNJS](https://img.shields.io/cdnjs/v/UAParser.js.svg)](https://cdnjs.com/libraries/UAParser.js)
* Author : Faisalman <<fyzlman@gmail.com>>
* Demo : http://faisalman.github.com/ua-parser-js
* Author : Faisal Salman <<f@faisalman.com>>
* Demo : http://faisalman.github.io/ua-parser-js
* Source : https://github.com/faisalman/ua-parser-js
## Features
# Constructor
Extract detailed type of web browser, layout engine, operating system, cpu architecture, and device purely from user-agent string with relatively lightweight footprint (~7KB minified / ~3KB gzipped). Written in vanilla js, which means it doesn't depends on any other library.
* `new UAParser([uastring][,extensions])`
* returns new instance
![It's over 9000](https://pbs.twimg.com/media/A9LpEG6CIAA5VrT.jpg)
* `UAParser([uastring][,extensions])`
* returns result object `{ ua: '', browser: {}, cpu: {}, device: {}, engine: {}, os: {} }`
## Methods
# Methods
* `getBrowser()`
* returns `{ name: '', major: '', version: '' }`
* returns `{ name: '', version: '' }`
```
```sh
# Possible 'browser.name':
Amaya, Arora, Avant, Baidu, Blazer, Bolt, Camino, Chimera, Chrome, Chromium,
Comodo Dragon, Conkeror, Dillo, Dolphin, Doris, Epiphany, Fennec, Firebird,
Firefox, Flock, GoBrowser, iCab, ICE Browser, IceApe, IceCat, IceDragon,
Iceweasel, IE [Mobile], Iron, Jasmine, K-Meleon, Konqueror, Kindle, Links,
Lunascape, Lynx, Maemo, Maxthon, Midori, Minimo, [Mobile] Safari, Mosaic, Mozilla,
Netfront, Netscape, NetSurf, Nokia, OmniWeb, Opera [Mini/Mobi/Tablet], Phoenix,
Polaris, QQBrowser, RockMelt, Silk, Skyfire, SeaMonkey, SlimBrowser, Swiftfox,
Tizen, UCBrowser, w3m, Yandex
2345Explorer, Amaya, Android Browser, Arora, Avant, BIDUBrowser, Baidu,
Basilisk, Blazer, Bolt, Bowser, Camino, Chimera, Chrome Headless,
Chrome WebView, Chrome, Chromium, Comodo Dragon, Dillo, Dolphin, Doris, Edge,
Epiphany, Facebook, Fennec, Firebird, Firefox, Flock, GSA, GoBrowser,
ICE Browser, IE, IEMobile, IceApe, IceCat, IceDragon, Iceape, Iceweasel,
Iridium, Iron, Jasmine, K-Meleon, Kindle, Konqueror, LBBROWSER Line, Links,
Lunascape, Lynx, MIUI Browser, Maemo Browser, Maemo, Maxthon, MetaSr Midori,
Minimo, Mobile Safari, Mosaic, Mozilla, NetFront, NetSurf, Netfront, Netscape,
NokiaBrowser, Oculus Browser, OmniWeb, Opera Coast, Opera Mini, Opera Mobi,
Opera Tablet, Opera, PaleMoon, PhantomJS, Phoenix, Polaris, Puffin, QQ,
QQBrowser, QQBrowserLite, Quark, RockMelt, Safari, Samsung Browser, SeaMonkey,
Silk, Skyfire, Sleipnir, Slim, SlimBrowser, Swiftfox, Tizen Browser, UCBrowser,
Vivaldi, Waterfox, WeChat, Yandex, baidu, iCab, w3m, ...
# 'browser.version' & 'browser.major' determined dynamically
# 'browser.version' determined dynamically
```
* `getDevice()`
* returns `{ model: '', type: '', vendor: '' }`
```
```sh
# Possible 'device.type':
console, mobile, tablet
console, mobile, tablet, smarttv, wearable, embedded
# Possible 'device.vendor':
Acer, Alcatel, Apple, Asus, BenQ, BlackBerry, Dell, GeeksPhone, HP, HTC, Huawei,
Lenovo, LG, Meizu, Motorola, Nexian, Nintendo, Nokia, Palm, Panasonic,
RIM, Samsung, Siemens, Sony-Ericsson, Sprint, ZTE
Acer, Alcatel, Amazon, Apple, Archos, Asus, BenQ, BlackBerry, Dell, Essential,
GeeksPhone, Google, HP, HTC, Huawei, Jolla, Lenovo, LG, Meizu, Microsoft, Motorola,
Nexian, Nintendo, Nokia, Nvidia, OnePlus, Ouya, Palm, Panasonic, Pebble, Polytron,
RIM, Samsung, Sharp, Siemens, Sony[Ericsson], Sprint, Xbox, Xiaomi, ZTE, ...
# 'device.model' determined dynamically
```
@@ -51,10 +63,10 @@ RIM, Samsung, Siemens, Sony-Ericsson, Sprint, ZTE
* `getEngine()`
* returns `{ name: '', version: '' }`
```
```sh
# Possible 'engine.name'
Amaya, Gecko, iCab, KHTML, Links, Lynx, NetFront, NetSurf, Presto, Tasman,
Trident, w3m, WebKit
Amaya, EdgeHTML, Gecko, iCab, KHTML, Links, Lynx, NetFront, NetSurf, Presto,
Tasman, Trident, w3m, WebKit
# 'engine.version' determined dynamically
```
@@ -62,14 +74,14 @@ Trident, w3m, WebKit
* `getOS()`
* returns `{ name: '', version: '' }`
```
```sh
# Possible 'os.name'
AIX, Amiga OS, Android, Arch, Bada, BeOS, BlackBerry, CentOS, Chromium OS,
Fedora, Firefox OS, FreeBSD, Debian, DragonFly, Gentoo, GNU, Haiku, Hurd, iOS,
Joli, Linux, Mac OS, Mandriva, MeeGo, Minix, Mint, Morph OS, NetBSD, Nintendo,
OpenBSD, OS/2, Palm, PCLinuxOS, Plan9, Playstation, QNX, RedHat, RIM Tablet OS,
RISC OS, Slackware, Solaris, SUSE, Symbian, Tizen, Ubuntu, UNIX, WebOS,
Windows [Phone/Mobile], Zenwalk
AIX, Amiga OS, Android, Arch, Bada, BeOS, BlackBerry, CentOS, Chromium OS, Contiki,
Fedora, Firefox OS, FreeBSD, Debian, DragonFly, Fuchsia, Gentoo, GNU, Haiku, Hurd, iOS,
Joli, Linpus, Linux, Mac OS, Mageia, Mandriva, MeeGo, Minix, Mint, Morph OS, NetBSD,
Nintendo, OpenBSD, OpenVMS, OS/2, Palm, PC-BSD, PCLinuxOS, Plan9, Playstation, QNX, RedHat,
RIM Tablet OS, RISC OS, Sailfish, Series40, Slackware, Solaris, SUSE, Symbian, Tizen,
Ubuntu, Unix, VectorLinux, WebOS, Windows [Phone/Mobile], Zenwalk, ...
# 'os.version' determined dynamically
```
@@ -77,19 +89,23 @@ Windows [Phone/Mobile], Zenwalk
* `getCPU()`
* returns `{ architecture: '' }`
```
```sh
# Possible 'cpu.architecture'
68k, amd64, arm, ia32, ia64, irix, irix64, mips, mips64, pa-risc, ppc, sparc, sparc64
68k, amd64, arm[64], avr, ia[32/64], irix[64], mips[64], pa-risc, ppc, sparc[64]
```
* `getResult()`
* returns `{ ua: '', browser: {}, cpu: {}, device: {}, engine: {}, os: {} }`
* `getUA()`
* returns UA string of current instance
* `setUA(uastring)`
* set & parse UA string
## Example
* `setUA(uastring)`
* set UA string to parse
* returns current instance
# Example
```html
<!doctype html>
@@ -108,8 +124,7 @@ Windows [Phone/Mobile], Zenwalk
ua: "",
browser: {
name: "",
version: "",
major: ""
version: ""
},
engine: {
name: "",
@@ -138,7 +153,7 @@ Windows [Phone/Mobile], Zenwalk
// this will also produce the same result (without instantiation):
// var result = UAParser(uastring);
console.log(result.browser); // {name: "Chromium", major: "15", version: "15.0.874.106"}
console.log(result.browser); // {name: "Chromium", version: "15.0.874.106"}
console.log(result.device); // {model: undefined, type: undefined, vendor: undefined}
console.log(result.os); // {name: "Ubuntu", version: "11.10"}
console.log(result.os.version); // "11.10"
@@ -163,49 +178,84 @@ Windows [Phone/Mobile], Zenwalk
</html>
```
### Using node.js
## Using node.js
```sh
$ npm install ua-parser-js
```
```js
var UAParser = require('ua-parser-js');
var parser = new UAParser();
var ua = request.headers['user-agent']; // user-agent header from an HTTP request
console.log(parser.setUA(ua).getResult());
var http = require('http');
var parser = require('ua-parser-js');
http.createServer(function (req, res) {
// get user-agent header
var ua = parser(req.headers['user-agent']);
// write the result as response
res.end(JSON.stringify(ua, null, ' '));
})
.listen(1337, '127.0.0.1');
console.log('Server running at http://127.0.0.1:1337/');
```
### Using requirejs
## Using requirejs
```js
require(['ua-parser'], function(UAParser) {
requirejs.config({
baseUrl : 'js/lib', // path to your script directory
paths : {
'ua-parser-js' : 'ua-parser.min'
}
});
requirejs(['ua-parser-js'], function(UAParser) {
var parser = new UAParser();
console.log(parser.getResult());
});
```
### Using component
## Using CDN
```sh
$ component install faisalman/ua-parser-js
```html
<script src="https://cdn.jsdelivr.net/npm/ua-parser-js@0/dist/ua-parser.min.js"></script>
```
```js
var UAParser = require('ua-parser-js');
var parser = new UAParser();
console.log(parser.getResult());
```
### Using bower
## Using bower
```sh
$ bower install ua-parser-js
```
### Using jQuery.ua
## Using meteor
Although written in vanilla js (which means it doesn't depends on jQuery), this library will automatically detect if jQuery 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)`.
```sh
$ meteor add faisalman:ua-parser-js
```
## Using TypeScript
```sh
$ npm install --save @types/ua-parser-js
# Download TS type definition from DefinitelyTyped repository:
# https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/ua-parser-js
```
## Using CLI
```sh
$ node ua-parser.min.js "Mozilla/4.0 (compatible; MSIE 4.01; Windows 98)"
# multiple args
$ node ua-parser.min.js "Opera/1.2" "Opera/3.4"
# piped args
$ echo "Opera/1.2" | node ua-parser.min.js
# log file
$ cat ua.log | node ua-parser.min.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)`.
```js
// In browser with default user-agent: 'Mozilla/5.0 (Linux; U; Android 2.3.4; en-us; Sprint APA7373KT Build/GRJ22) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0':
@@ -224,29 +274,60 @@ console.log($.ua.browser.name); // "Safari"
console.log($.ua.engine.name); // "Webkit"
console.log($.ua.device); // {vendor: "Motorola", model: "Xoom", type: "tablet"}
console.log(parseInt($.ua.browser.version.split('.')[0], 10)); // 4
// Add class to <body> tag
// <body class="ua-browser-safari ua-devicetype-tablet">
$('body').addClass('ua-browser-' + $.ua.browser.name + ' ua-devicetype-' + $.ua.device.type);
```
## Development
## Extending regex patterns
Install dependencies
* `UAParser([uastring,] extensions)`
Pass your own regexes to extend the limited matching rules.
```js
// Example:
var myOwnRegex = [[/(myownbrowser)\/([\w\.]+)/i], [UAParser.BROWSER.NAME, UAParser.BROWSER.VERSION]];
var myParser = new UAParser({ browser: myOwnRegex });
var uaString = 'Mozilla/5.0 MyOwnBrowser/1.3';
console.log(myParser.setUA(uaString).getBrowser()); // {name: "MyOwnBrowser", version: "1.3"}
```
# Development
## Contribute
* Fork and clone this repository
* Make some changes as required
* Write a unit test to showcase your feature
* Run the test suites to make sure the changes you made didn't break anything `$ npm run test`
* Commit and push to your own repository
* Submit a pull request to this repository under `develop` branch
* Profit? $$$
## Build
Build a minified & packed script
```sh
$ npm install jshint
$ npm install mocha
$ npm install uglify-js
$ npm run build
```
Verify, test, & minify script
```sh
$ ./build/build.sh
```
# Donate
## License
Do you use & like UAParser.js but you dont find a way to show some love? If yes, please consider donating to support this project. Otherwise, no worries, regardless of whether there is support or not, I will keep maintaining this project. Still, if you buy me a cup of coffee I would be more than happy though :)
Dual licensed under GPLv2 & MIT
[![Support via PayPal](https://cdn.rawgit.com/twolfson/paypal-github-button/1.0.0/dist/button.svg)](https://www.paypal.me/faisalman/)
Copyright © 2012-2013 Faisalman <<fyzlman@gmail.com>>
# License
Dual licensed under GPLv2 or MIT
Copyright © 2012-2018 Faisal Salman <<f@faisalman.com>>
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
@@ -257,3 +338,11 @@ subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

879
src/ua-parser.js Normal file → Executable file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@@ -47,6 +47,14 @@
"architecture" : "arm"
}
},
{
"desc" : "ARMv7",
"ua" : "Mozilla/5.0 (X11; CrOS armv7l 9765.85.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.123 Safari/537.36",
"expect" :
{
"architecture" : "arm"
}
},
{
"desc" : "Pocket PC",
"ua" : "Opera/9.7 (Windows Mobile; PPC; Opera Mobi/35166; U; en) Presto/2.2.1",
@@ -102,21 +110,5 @@
{
"architecture" : "amd64"
}
},
{
"desc" : "KTB iPad",
"ua" : "APP-BE Test/1.0 (iPad; Apple; CPU iPhone OS 7_0_2 like Mac OS X)",
"expect" :
{
"architecture" : "undefined"
}
},
{
"desc" : "KTB-Nexus 5",
"ua" : "APP-My App/1.0 (Linux; Android 4.2.1; Nexus 5 Build/JOP40D)",
"expect" :
{
"architecture" : "undefined"
}
}
]

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,13 @@
[
{
"desc" : "EdgeHTML",
"ua" : "Mozilla/5.0 (Windows NT 6.4; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.143 Safari/537.36 Edge/12.0",
"expect" :
{
"name" : "EdgeHTML",
"version" : "12.0"
}
},
{
"desc" : "Gecko",
"ua" : "Mozilla/5.0 (X11; Linux x86_64; rv:2.0b9pre) Gecko/20110111 Firefox/4.0b9pre",
@@ -61,24 +70,5 @@
"name" : "WebKit",
"version" : "533.19.4"
}
},
{
"desc" : "KTA Mobile App",
"ua" : "APP-BE Test/1.0 (iPad; Apple; CPU iPhone OS 7_0_2 like Mac OS X)",
"expect" :
{
"name" : "Mobile-App",
"version" : "1.0"
}
},
{
"desc" : "KTB-Nexus 5",
"ua" : "APP-My App/1.0 (Linux; Android 4.2.1; Nexus 5 Build/JOP40D)",
"expect" :
{
"name" : "Mobile-App",
"version" : "1.0"
}
}
]

582
test/mediaplayer-test.json Normal file
View File

@@ -0,0 +1,582 @@
[
{
"desc" : "Coremedia",
"ua" : "Apple Mac OS X v10.6.4 CoreMedia v1.0.0.10F2108",
"expect" :
{
"name" : "CoreMedia",
"version" : "1.0.0.10F2108",
"major" : "1"
}
},
{
"desc" : "AppleCoreMedia",
"ua" : "AppleCoreMedia/1.0.0.10A403 (iPad; U; CPU OS 6_0 like Mac OS X; it_it)",
"expect" :
{
"name" : "AppleCoreMedia",
"version" : "1.0.0.10A403",
"major" : "1"
}
},
{
"desc" : "AppleTv",
"ua" : "AppleTV/3.0.2 (Macintosh; Intel Mac OS X 10.4.7) AppleWebKit/528.18",
"expect" :
{
"name" : "WebKit",
"version" : "528.18",
"major" : "528"
}
},
{
"desc" : "Aqualung",
"ua" : "Aqualung/R-1114",
"expect" :
{
"name" : "Aqualung",
"version" : "R-1114",
"major" : "undefined"
}
},
{
"desc" : "Ares",
"ua" : "Ares 2.2.4.3048",
"expect" :
{
"name" : "Ares",
"version" : "2.2.4.3048",
"major" : "2"
}
},
{
"desc" : "Audacious",
"ua" : "Audacious/3.2.2 neon/0.29.3",
"expect" :
{
"name" : "Audacious",
"version" : "3.2.2",
"major" : "3"
}
},
{
"desc" : "AudiMusicStream",
"ua" : "AudiMusicStream/3020.130826151911",
"expect" :
{
"name" : "AudiMusicStream",
"version" : "3020.130826151911",
"major" : "3020"
}
},
{
"desc" : "BASS",
"ua" : "BASS/2.4",
"expect" :
{
"name" : "BASS",
"version" : "2.4",
"major" : "2"
}
},
{
"desc" : "BSPlayer",
"ua" : "BSPlayer/2",
"expect" :
{
"name" : "BSPlayer",
"version" : "2",
"major" : "2"
}
},
{
"desc" : "Core",
"ua" : "CORE/6.506.4.1",
"expect" :
{
"name" : "CORE",
"version" : "6.506.4.1",
"major" : "6"
}
},
{
"desc" : "Clementine",
"ua" : "Clementine 1.1",
"expect" :
{
"name" : "Clementine",
"version" : "1.1",
"major" : "1"
}
},
{
"desc" : "Dalvik",
"ua" : "Dalvik/1.2.0 (Linux; U; Android 2.2.1; GT-S5830L Build/FROYO)",
"expect" :
{
"name" : "Dalvik",
"version" : "1.2.0",
"major" : "1"
}
},
{
"desc" : "NexPlayer",
"ua" : "E97510d/ Player/NexPlayer 4.0",
"expect" :
{
"name" : "NexPlayer",
"version" : "4.0",
"major" : "4"
}
},
{
"desc" : "FLRP",
"ua" : "FLRP/2.5 CFNetwork/609.1.4 Darwin/13.0.0",
"expect" :
{
"name" : "Flip Player",
"version" : "2.5",
"major" : "2"
}
},
{
"desc" : "FStream",
"ua" : "FStream",
"expect" :
{
"name" : "FStream",
"version" : "undefined",
"major" : "undefined"
}
},
{
"desc" : "GStreamer",
"ua" : "GStreamer souphttpsrc (compatible; LG NetCast.TV-2012) libsoup/2.34.2",
"expect" :
{
"name" : "GStreamer",
"version" : "2.34.2",
"major" : "2"
}
},
{
"desc" : "GnomeMplayer",
"ua" : "GnomeMplayer/1.0.2",
"expect" :
{
"name" : "GnomeMplayer",
"version" : "1.0.2",
"major" : "1"
}
},
{
"desc" : "HTC Streaming Player",
"ua" : "HTC Streaming Player htc_asia_wwe / 1.0 / endeavoru / 4.1.1",
"expect" :
{
"name" : "HTC Streaming Player",
"version" : "1.0",
"major" : "1"
}
},
{
"desc" : "HTC One S",
"ua" : "HTC_One_S/3.16.111.10",
"expect" :
{
"name" : "HTC One S",
"version" : "3.16.111.10",
"major" : "3"
}
},
{
"desc" : "Java",
"ua" : "Java/1.4.1_04",
"expect" :
{
"name" : "Java",
"version" : "1.4.1_04",
"major" : "1"
}
},
{
"desc" : "LG Player",
"ua" : "LG Player 1.0; Android",
"expect" :
{
"name" : "LG Player",
"version" : "1.0",
"major" : "1"
}
},
{
"desc" : "NexPlayer",
"ua" : "LG-P700/V10k-DEC-12-2012 Player/NexPlayer 4.0 for Android",
"expect" :
{
"name" : "NexPlayer",
"version" : "4.0",
"major" : "4"
}
},
{
"desc" : "LG Player",
"ua" : "LGE400/V10b Player/LG Player 1.0",
"expect" :
{
"name" : "LG Player",
"version" : "1.0",
"major" : "1"
}
},
{
"desc" : "Lavf",
"ua" : "Lavf52.111.0",
"expect" :
{
"name" : "Lavf",
"version" : "52.111.0",
"major" : "52"
}
},
{
"desc" : "Lyssna",
"ua" : "Lyssna/46 CFNetwork/609.1.4 Darwin/13.0.0",
"expect" :
{
"name" : "Lyssna",
"version" : "46",
"major" : "46"
}
},
{
"desc" : "MPlayer",
"ua" : "MPlayer 1.1-4.2.1",
"expect" :
{
"name" : "MPlayer",
"version" : "1.1-4.2.1",
"major" : ""
}
},
{
"desc" : "MPlayer SVN",
"ua" : "MPlayer SVN-r33713-4.6.1",
"expect" :
{
"name" : "MPlayer",
"version" : "r33713-4.6.1",
"major" : "undefined"
}
},
{
"desc" : "MPlayer ubuntu",
"ua" : "MPlayer svn r34540 (Ubuntu), built with gcc-4.6",
"expect" :
{
"name" : "MPlayer",
"version" : "r34540",
"major" : "undefined"
}
},
{
"desc" : "MoC",
"ua" : "Music On Console/2.5.0-beta1",
"expect" :
{
"name" : "Music On Console",
"version" : "2.5.0-beta1",
"major" : "2"
}
},
{
"desc" : "MPD",
"ua" : "Music Player Daemon 0.17.4",
"expect" :
{
"name" : "Music Player Daemon",
"version" : "0.17.4",
"major" : "0"
}
},
{
"desc" : "NSPlayer",
"ua" : "NSPlayer/11.0.5358.4827 WMFSDK/11.0",
"expect" :
{
"name" : "NSPlayer",
"version" : "11.0.5358.4827",
"major" : "11"
}
},
{
"desc" : "Nero Home",
"ua" : "Nero Home/1.5.3.0 (compatible; Nero AG; Nero Home 1.5.3.0)",
"expect" :
{
"name" : "Nero Home",
"version" : "1.5.3.0",
"major" : "1"
}
},
{
"desc" : "NexPlayer",
"ua" : "NexPlayer 4.0 for Android( stagefright alternative )",
"expect" :
{
"name" : "NexPlayer",
"version" : "4.0",
"major" : "4"
}
},
{
"desc" : "Nokia3xx",
"ua" : "Nokia303/14.87 CLDC-1.1",
"expect" :
{
"name" : "Nokia303",
"version" : "14.87",
"major" : "14"
}
},
{
"desc" : "MPlayer SVN Sherpya",
"ua" : "MPlayer Sherpya-SVN-r33124-4.2.5",
"expect" :
{
"name" : "MPlayer",
"version" : "r33124-4.2.5",
"major" : "undefined"
}
},
{
"desc" : "Philips Songbird",
"ua" : "NotMoz/5.0 (Windows; U; Windows NT 5.1; it; rv:1.9.2.3) Gecko/20101207 Philips-Songbird/5.4.1980 Songbird/1.9.4 (20110302030555)",
"expect" :
{
"name" : "Songbird",
"version" : "1.9.4",
"major" : "1"
}
},
{
"desc" : "Ossproxy",
"ua" : "OSSProxy 1.3.336.320 (Build 336.320 Win32 en-us)(Aug 16 2013 17:38:43)",
"expect" :
{
"name" : "OSSProxy",
"version" : "1.3.336.320",
"major" : "1"
}
},
{
"desc" : "Winamp3",
"ua" : "Nullsoft Winamp3 version 3.0 (compatible)",
"expect" :
{
"name" : "Winamp",
"version" : "3.0",
"major" : "3"
}
},
{
"desc" : "PSP",
"ua" : "PSP-InternetRadioPlayer/1.00",
"expect" :
{
"name" : "PSP-InternetRadioPlayer",
"version" : "1.00",
"major" : "1"
}
},
{
"desc" : "urllib",
"ua" : "Python-urllib/2.7",
"expect" :
{
"name" : "Python-urllib",
"version" : "2.7",
"major" : "2"
}
},
{
"desc" : "QuickTime",
"ua" : "QuickTime/7.5.6 (qtver=7.5.6;cpu=IA32;os=Mac 10.5.8)",
"expect" :
{
"name" : "QuickTime",
"version" : "7.5.6",
"major" : "7"
}
},
{
"desc" : "RMA",
"ua" : "RMA/1.0 (compatible; RealMedia)",
"expect" :
{
"name" : "RMA",
"version" : "1.0",
"major" : "1"
}
},
{
"desc" : "RadioApp",
"ua" : "RadioApp/1.0 CFNetwork/609.1.4 Darwin/11.4.2",
"expect" :
{
"name" : "RadioApp",
"version" : "1.0",
"major" : "1"
}
},
{
"desc" : "RadioClientApplication",
"ua" : "RadioClientApplication/20 CFNetwork/609.1.4 Darwin/13.0.0",
"expect" :
{
"name" : "RadioClientApplication",
"version" : "20",
"major" : "undefined"
}
},
{
"desc" : "stagefright",
"ua" : "Samsung GT-I9070 stagefright/1.1 (Linux;Android 2.3.6)",
"expect" :
{
"name" : "stagefright",
"version" : "1.1",
"major" : "1"
}
},
{
"desc" : "Soundtap",
"ua" : "Soundtap/1.2.4 CFNetwork/672.0.2 Darwin/14.0.0",
"expect" :
{
"name" : "Soundtap",
"version" : "1.2.4",
"major" : "1"
}
},
{
"desc" : "Streamium",
"ua" : "Streamium/1.0",
"expect" :
{
"name" : "Streamium",
"version" : "1.0",
"major" : "1"
}
},
{
"desc" : "Totem",
"ua" : "Totem/3.0.1",
"expect" :
{
"name" : "Totem",
"version" : "3.0.1",
"major" : "3"
}
},
{
"desc" : "VLC",
"ua" : "VLC media player - version 0.8.6c Janus - (c) 1996-2007 the VideoLAN team",
"expect" :
{
"name" : "VLC",
"version" : "0.8.6c",
"major" : "0"
}
},
{
"desc" : "VLC",
"ua" : "VLC/2.0.0 LibVLC/2.0.0",
"expect" :
{
"name" : "VLC",
"version" : "2.0.0",
"major" : "2"
}
},
{
"desc" : "Videos",
"ua" : "Videos/3.8.2",
"expect" :
{
"name" : "Video",
"version" : "3.8.2",
"major" : "3"
}
},
{
"desc" : "Wget",
"ua" : "Wget/1.12 (darwin10.7.0)",
"expect" :
{
"name" : "Wget",
"version" : "1.12",
"major" : "1"
}
},
{
"desc" : "Winamp",
"ua" : "Winamp 2.81",
"expect" :
{
"name" : "Winamp",
"version" : "2.81",
"major" : "2"
}
},
{
"desc" : "Winamp",
"ua" : "WinampMPEG/2.00",
"expect" :
{
"name" : "Winamp",
"version" : "2.00",
"major" : "2"
}
},
{
"desc" : "Windows Media Player",
"ua" : "Windows-Media-Player/10.00.00.4019",
"expect" :
{
"name" : "Windows Media Player",
"version" : "10.00.00.4019",
"major" : "10"
}
},
{
"desc" : "XBMC",
"ua" : "XBMC/12.0 Git:20130127-fb595f2 (Windows NT 6.1;WOW64;Win64;x64; http://www.xbmc.org)",
"expect" :
{
"name" : "XBMC",
"version" : "12.0",
"major" : "12"
}
},
{
"desc" : "rad.io",
"ua" : "rad.io 1.18.1 rv:593 (iPhone 4S; iPhone OS 7.0.4; it_IT)",
"expect" :
{
"name" : "rad.io",
"version" : "1.18.1",
"major" : "1"
}
},
{
"desc" : "BE-Test",
"ua" : "APP-BE Test/1.0 (iPad; Apple; CPU iPhone OS 7_0_2 like Mac OS X)",
"expect" :
{
"name" : "BE Test",
"version" : "1.0",
"major" : "1"
}
}
]

View File

@@ -71,6 +71,15 @@
"version" : "8"
}
},
{
"desc" : "Windows 10",
"ua" : "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0",
"expect" :
{
"name" : "Windows",
"version" : "10"
}
},
{
"desc" : "Windows RT",
"ua" : "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; ARM; Trident/6.0)",
@@ -98,6 +107,15 @@
"version" : "6.1"
}
},
{
"desc" : "Windows Phone",
"ua" : "Opera/9.80 (Windows Phone; Opera Mini/7.6.8/35.7518; U; ru) Presto/2.8.119 Version/11.10",
"expect" :
{
"name" : "Windows Phone",
"version" : "undefined"
}
},
{
"desc" : "Windows Phone OS",
"ua" : "Mozilla/4.0 (compatible; MSIE 7.0; Windows Phone OS 7.0; Trident/3.1; IEMobile/7.0; DELL; Venue Pro)",
@@ -136,11 +154,11 @@
},
{
"desc" : "Tizen",
"ua" : "",
"ua" : "Mozilla/5.0 (Linux; Tizen 2.3; SAMSUNG SM-Z130H) AppleWebKit/537.3 (KHTML, like Gecko) Version/2.3 Mobile Safari/537.3",
"expect" :
{
"name" : "",
"version" : ""
"name" : "Tizen",
"version" : "2.3"
}
},
{
@@ -242,6 +260,15 @@
"version" : ""
}
},
{
"desc" : "PlayStation 4",
"ua" : "Mozilla/5.0 (PlayStation 4 3.00) AppleWebKit/537.73 (KHTML, like Gecko)",
"expect" :
{
"name" : "PlayStation",
"version" : "4"
}
},
{
"desc" : "Mint",
"ua" : "",
@@ -262,11 +289,20 @@
},
{
"desc" : "Ubuntu",
"ua" : "",
"ua" : "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.22+ (KHTML, like Gecko) Chromium/17.0.963.56 Chrome/17.0.963.56 Safari/535.22+ Ubuntu/12.04 (3.4.1-0ubuntu1) Epiphany/3.4.1",
"expect" :
{
"name" : "",
"version" : ""
"name" : "Ubuntu",
"version" : "12.04"
}
},
{
"desc" : "Ubuntu",
"ua" : "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/31.0.1650.63 Chrome/31.0.1650.63 Safari/537.36",
"expect" :
{
"name" : "Ubuntu",
"version" : "undefined"
}
},
{
@@ -397,11 +433,20 @@
},
{
"desc" : "Chromium OS",
"ua" : "",
"ua" : "Mozilla/5.0 (X11; CrOS x86_64 10575.58.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36",
"expect" :
{
"name" : "",
"version" : ""
"name" : "Chromium OS",
"version" : "10575.58.0"
}
},
{
"desc" : "Fuchsia",
"ua" : "Mozilla/5.0 (X11; Fuchsia x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3557.0 Safari/537.36",
"expect" :
{
"name" : "Fuchsia",
"version" : "undefined"
}
},
{
@@ -449,6 +494,15 @@
"version" : ""
}
},
{
"desc" : "iOS in App",
"ua" : "AppName/version CFNetwork/version Darwin/version",
"expect" :
{
"name" : "iOS",
"version" : "undefined"
}
},
{
"desc" : "iOS with Chrome",
"ua" : "Mozilla/5.0 (iPhone; U; CPU iPhone OS 5_1_1 like Mac OS X; en) AppleWebKit/534.46.0 (KHTML, like Gecko) CriOS/19.0.1084.60 Mobile/9B206 Safari/7534.48.3",
@@ -472,17 +526,17 @@
"ua" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.95 Safari/537.36",
"expect" :
{
"name" : "Mac OS X",
"name" : "Mac OS",
"version" : "10.6.8"
}
},
{
"desc" : "Haiku",
"ua" : "",
"ua" : "Mozilla/5.0 (Macintosh; Intel Haiku R1 x86) AppleWebKit/602.1.1 (KHTML, like Gecko) WebPositive/1.2 Version/8.0 Safari/602.1.1",
"expect" :
{
"name" : "",
"version" : ""
"name" : "Haiku",
"version" : "R1"
}
},
{

View File

@@ -1,4 +1,5 @@
var assert = require('assert');
var requirejs = require('requirejs');
var UAParser = require('./../src/ua-parser');
var browsers = require('./browser-test.json');
var cpus = require('./cpu-test.json');
@@ -48,9 +49,9 @@ for (var i in methods) {
for (var j in methods[i]['list']) {
if (!!methods[i]['list'][j].ua) {
describe('[' + methods[i]['list'][j].desc + ']', function () {
describe('"' + methods[i]['list'][j].ua + '"', function () {
describe('"' + methods[i]['list'][j].ua + '"', function () {
var expect = methods[i]['list'][j].expect;
var result = parser.setUA(methods[i]['list'][j].ua).getResult()[methods[i]['label']];
var result = parser.setUA(methods[i]['list'][j].ua).getResult()[methods[i]['label']];
methods[i]['properties'].forEach(function(m) {
it('should return ' + methods[i]['label'] + ' ' + m + ': ' + expect[m], function () {
@@ -63,3 +64,50 @@ for (var i in methods) {
}
});
}
describe('Returns', function () {
it('getResult() should returns JSON', function(done) {
assert.deepEqual(new UAParser('').getResult(),
{
ua : '',
browser: { name: undefined, version: undefined, major: undefined },
cpu: { architecture: undefined },
device: { vendor: undefined, model: undefined, type: undefined },
engine: { name: undefined, version: undefined},
os: { name: undefined, version: undefined }
});
done();
});
});
describe('Extending Regex', function () {
var uaString = 'Mozilla/5.0 MyOwnBrowser/1.3';
var myOwnBrowser = [[/(myownbrowser)\/((\d+)?[\w\.]+)/i], [UAParser.BROWSER.NAME, UAParser.BROWSER.VERSION, UAParser.BROWSER.MAJOR]];
var parser1 = new UAParser(uaString, {browser: myOwnBrowser});
assert.equal(parser1.getBrowser().name, 'MyOwnBrowser');
assert.equal(parser1.getBrowser().version, '1.3');
assert.equal(parser1.getBrowser().major, '1');
var parser2 = new UAParser({browser: myOwnBrowser});
assert.equal(parser2.getBrowser().name, undefined);
parser2.setUA(uaString);
assert.equal(parser2.getBrowser().name, 'MyOwnBrowser');
assert.equal(parser1.getBrowser().version, '1.3');
});
describe('Using Require.js', function () {
it('should loaded automatically', function(done) {
requirejs.config({
baseUrl : 'dist',
paths : {
'ua-parser-js' : 'ua-parser.min'
}
});
requirejs(['ua-parser-js'], function(ua) {
var parser = new ua('Dillo/1.0');
assert.deepEqual(parser.getBrowser().name, 'Dillo');
done();
});
});
});

View File

@@ -1,32 +0,0 @@
{
"title": "UAParser.js",
"name": "ua-parser-js",
"version": "0.6.16",
"description": "Lightweight JavaScript-based user-agent string parser",
"keywords": [
"user-agent",
"parser",
"browser",
"engine",
"os",
"device",
"cpu"
],
"homepage": "https://faisalman.github.com/ua-parser-js",
"author": {
"name": "Faisal Salman",
"email": "fyzlman@gmail.com"
},
"dependencies": {
"jquery": ">=1.5"
},
"licenses": [
{
"type": "MIT",
"url": "http://www.opensource.org/licenses/mit-license.php"
}
],
"bugs": "https://github.com/faisalman/ua-parser-js/issues",
"docs": "https://github.com/faisalman/ua-parser-js",
"download": "https://raw.github.com/faisalman/ua-parser-js/master/src/ua-parser.min.js"
}