From d1ba5f591425b8e5406e7faafc9b7cedd7240323 Mon Sep 17 00:00:00 2001 From: Faisal Salman Date: Thu, 18 Mar 2021 00:19:41 +0700 Subject: [PATCH] Fix #430 Playstation 5 --- src/ua-parser.js | 4 ++-- test/device-test.json | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/ua-parser.js b/src/ua-parser.js index 22fc18d..4f417dc 100755 --- a/src/ua-parser.js +++ b/src/ua-parser.js @@ -488,7 +488,7 @@ /android.+;\s(shield)\sbuild/i // Nvidia ], [MODEL, [VENDOR, 'Nvidia'], [TYPE, CONSOLE]], [ - /(playstation\s[34portablevi]+)/i // Playstation + /(playstation\s[345portablevi]+)/i // Playstation ], [MODEL, [VENDOR, 'Sony'], [TYPE, CONSOLE]], [ /(sprint\s(\w+))/i // Sprint Phones @@ -761,7 +761,7 @@ ], [VERSION, [NAME, 'Chromecast']], [ // Console - /(nintendo|playstation)\s([wids34portablevuch]+)/i, // Nintendo/Playstation + /(nintendo|playstation)\s([wids345portablevuch]+)/i, // Nintendo/Playstation // GNU/Linux based /(mint)[\/\s\(]?(\w*)/i, // Mint diff --git a/test/device-test.json b/test/device-test.json index 20681e7..a544b93 100644 --- a/test/device-test.json +++ b/test/device-test.json @@ -774,6 +774,15 @@ "type": "console" } }, + { + "desc": "PlayStation 5", + "ua": "Mozilla/5.0 (Playstation; Playstation 5/1.05) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0 Safari/605.1.15", + "expect": { + "vendor": "Sony", + "model": "Playstation 5", + "type": "console" + } + }, { "desc": "Nintendo Switch", "ua": "Mozilla/5.0 (Nintendo Switch; WifiWebAuthApplet) AppleWebKit/606.4 (KHTML, like Gecko) NF/6.0.1.15.4 NintendoBrowser/5.1.0.20393",