Skip to content

Commit

Permalink
Merge pull request faisalman#140 from 0x7f/playstation4
Browse files Browse the repository at this point in the history
Add Playstation 4 support.
  • Loading branch information
faisalman committed Oct 16, 2015
2 parents 116b5c6 + ab6a56d commit f670224
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ua-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@
/android.+;\s(shield)\sbuild/i // Nvidia
], [MODEL, [VENDOR, 'Nvidia'], [TYPE, CONSOLE]], [

/(playstation\s[3portablevi]+)/i // Playstation
/(playstation\s[34portablevi]+)/i // Playstation
], [MODEL, [VENDOR, 'Sony'], [TYPE, CONSOLE]], [

/(sprint\s(\w+))/i // Sprint Phones
Expand Down Expand Up @@ -705,7 +705,7 @@
], [[NAME, 'Firefox OS'], VERSION], [

// Console
/(nintendo|playstation)\s([wids3portablevu]+)/i, // Nintendo/Playstation
/(nintendo|playstation)\s([wids34portablevu]+)/i, // Nintendo/Playstation

// GNU/Linux based
/(mint)[\/\s\(]?(\w+)*/i, // Mint
Expand Down
10 changes: 10 additions & 0 deletions test/device-test.json
Original file line number Diff line number Diff line change
Expand Up @@ -248,5 +248,15 @@
"model" : "MI-ONE Plus",
"type" : "mobile"
}
},
{
"desc" : "PlayStation 4",
"ua" : "Mozilla/5.0 (PlayStation 4 3.00) AppleWebKit/537.73 (KHTML, like Gecko)",
"expect" :
{
"vendor" : "Sony",
"model" : "PlayStation 4",
"type" : "console"
}
}
]
9 changes: 9 additions & 0 deletions test/os-test.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,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" : "",
Expand Down

0 comments on commit f670224

Please sign in to comment.