Skip to content

Commit

Permalink
Fix #682 - Add new browser: Smart Lenovo Browser
Browse files Browse the repository at this point in the history
  • Loading branch information
faisalman committed Oct 19, 2023
1 parent 69ed6ce commit d565f65
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/ua-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
BLACKBERRY = 'BlackBerry',
GOOGLE = 'Google',
HUAWEI = 'Huawei',
LENOVO = 'Lenovo',
LG = 'LG',
MICROSOFT = 'Microsoft',
MOTOROLA = 'Motorola',
Expand Down Expand Up @@ -326,6 +327,8 @@
], [VERSION, [NAME, 'IE']], [
/ya(?:search)?browser\/([\w\.]+)/i // Yandex
], [VERSION, [NAME, 'Yandex']], [
/slbrowser\/([\w\.]+)/i // Smart Lenovo Browser
], [VERSION, [NAME, 'Smart ' + LENOVO + SUFFIX_BROWSER]], [
/(avast|avg)\/([\w\.]+)/i // Avast/AVG Secure Browser
], [[NAME, /(.+)/, '$1 Secure' + SUFFIX_BROWSER], VERSION], [
/\bfocus\/([\w\.]+)/i // Firefox Focus
Expand Down Expand Up @@ -540,7 +543,7 @@
// Lenovo
/(ideatab[-\w ]+)/i,
/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i
], [MODEL, [VENDOR, 'Lenovo'], [TYPE, TABLET]], [
], [MODEL, [VENDOR, LENOVO], [TYPE, TABLET]], [

// Nokia
/(?:maemo|nokia).*(n900|lumia \d+)/i,
Expand Down
20 changes: 20 additions & 0 deletions test/specs/browser-all.json
Original file line number Diff line number Diff line change
Expand Up @@ -748,6 +748,26 @@
"major" : "5"
}
},
{
"desc" : "Smart Lenovo Browser",
"ua" : "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36 SLBrowser/8.0.0.10171 SLBChan/8",
"expect" :
{
"name" : "Smart Lenovo Browser",
"version" : "8.0.0.10171",
"major" : "8"
}
},
{
"desc" : "Smart Lenovo Browser",
"ua" : "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36 SLBrowser/9.0.0.9011 SLBChan/10",
"expect" :
{
"name" : "Smart Lenovo Browser",
"version" : "9.0.0.9011",
"major" : "9"
}
},
{
"desc" : "LINE on Android",
"ua" : "Mozilla/5.0 (Linux; Android 5.0; ASUS_Z00AD Build/LRX21V; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/51.0.2704.81 Mobile Safari/537.36 Line/6.5.1/IAB",
Expand Down

0 comments on commit d565f65

Please sign in to comment.