Skip to content

Commit

Permalink
Fix #492 LG TV WebOS detection
Browse files Browse the repository at this point in the history
  • Loading branch information
faisalman committed Apr 6, 2021
1 parent 3edacdd commit 642c039
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/ua-parser.js
Expand Up @@ -720,6 +720,7 @@
], [VERSION, [NAME, 'Symbian']], [
/mozilla.+\(mobile;.+gecko.+firefox/i // Firefox OS
], [[NAME, 'Firefox OS']], [
/web0s;.+rt(tv)/i,
/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i // WebOS
], [VERSION, [NAME, 'webOS']], [

Expand Down
45 changes: 45 additions & 0 deletions test/engine-test.json
Expand Up @@ -106,5 +106,50 @@
"name" : "WebKit",
"version" : "537.36"
}
},
{
"desc" : "WebOS TV 5.x",
"ua" : "Mozilla/5.0 (Web0S; Linux/SmartTV) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36 WebAppManager",
"expect" :
{
"name" : "Blink",
"version" : "68.0.3440.106"
}
},
{
"desc" : "WebOS TV 4.x",
"ua" : "Mozilla/5.0 (Web0S; Linux/SmartTV) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.34 Safari/537.36 WebAppManager",
"expect" :
{
"name" : "Blink",
"version" : "53.0.2785.34"
}
},
{
"desc" : "WebOS TV 3.x",
"ua" : "Mozilla/5.0 (Web0S; Linux/SmartTV) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5.2.1 Chrome/38.0.2125.122 Safari/537.36 WebAppManager",
"expect" :
{
"name" : "Blink",
"version" : "38.0.2125.122"
}
},
{
"desc" : "WebOS TV 2.x",
"ua" : "Mozilla/5.0 (Web0S; Linux/SmartTV) AppleWebKit/538.2 (KHTML, like Gecko) Large Screen WebAppManager Safari/538.2",
"expect" :
{
"name" : "WebKit",
"version" : "538.2"
}
},
{
"desc" : "WebOS TV 1.x",
"ua" : "Mozilla/5.0 (Web0S; Linux/SmartTV) AppleWebKit/537.41 (KHTML, like Gecko) Large Screen WebAppManager Safari/537.41",
"expect" :
{
"name" : "WebKit",
"version" : "537.41"
}
}
]
45 changes: 45 additions & 0 deletions test/os-test.json
Expand Up @@ -206,6 +206,51 @@
"version" : "1.4.5"
}
},
{
"desc" : "WebOS TV 5.x",
"ua" : "Mozilla/5.0 (Web0S; Linux/SmartTV) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36 WebAppManager",
"expect" :
{
"name" : "webOS",
"version" : "TV"
}
},
{
"desc" : "WebOS TV 4.x",
"ua" : "Mozilla/5.0 (Web0S; Linux/SmartTV) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.34 Safari/537.36 WebAppManager",
"expect" :
{
"name" : "webOS",
"version" : "TV"
}
},
{
"desc" : "WebOS TV 3.x",
"ua" : "Mozilla/5.0 (Web0S; Linux/SmartTV) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5.2.1 Chrome/38.0.2125.122 Safari/537.36 WebAppManager",
"expect" :
{
"name" : "webOS",
"version" : "TV"
}
},
{
"desc" : "WebOS TV 2.x",
"ua" : "Mozilla/5.0 (Web0S; Linux/SmartTV) AppleWebKit/538.2 (KHTML, like Gecko) Large Screen WebAppManager Safari/538.2",
"expect" :
{
"name" : "webOS",
"version" : "TV"
}
},
{
"desc" : "WebOS TV 1.x",
"ua" : "Mozilla/5.0 (Web0S; Linux/SmartTV) AppleWebKit/537.41 (KHTML, like Gecko) Large Screen WebAppManager Safari/537.41",
"expect" :
{
"name" : "webOS",
"version" : "TV"
}
},
{
"desc" : "QNX",
"ua" : "Mozilla/5.0 (Photon; U; QNX x86pc; en-US; rv:1.8.1.20) Gecko/20090127 BonEcho/2.0.0.20",
Expand Down

0 comments on commit 642c039

Please sign in to comment.