Skip to content

Commit

Permalink
Fix #683 - change MetaSr into Sogou Explorer (+add Sogou Mobile)
Browse files Browse the repository at this point in the history
  • Loading branch information
faisalman committed Oct 12, 2023
1 parent b51ae9e commit 69ed6ce
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/main/ua-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
FIREFOX = 'Firefox',
OPERA = 'Opera',
FACEBOOK = 'Facebook',
KLARNA = 'Klarna',
SOGOU = 'Sogou',
WINDOWS = 'Windows';

var NAVIGATOR = (typeof window !== UNDEF_TYPE && window.navigator) ?
Expand Down Expand Up @@ -348,11 +348,14 @@
], [[NAME, /(.+)/, '$1' + SUFFIX_BROWSER], VERSION], [ // Oculus/Samsung/Sailfish/HuaweiBrowser/VivoBrowser
/(comodo_dragon)\/([\w\.]+)/i // Comodo Dragon
], [[NAME, /_/g, ' '], VERSION], [
/metasr[\/ ]?([\d\.]+)/i // Sogou Explorer
], [VERSION, [NAME, SOGOU + ' Explorer']], [
/(sogou)mo\w+\/([\d\.]+)/i // Sogou Mobile
], [[NAME, SOGOU + ' Mobile'], VERSION], [
/(electron)\/([\w\.]+) safari/i, // Electron-based App
/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i, // Tesla
/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i // QQBrowser/Baidu App/2345 Browser
], [NAME, VERSION], [
/(metasr)[\/ ]?([\w\.]+)/i, // SouGouBrowser
/(lbbrowser)/i, // LieBao Browser
/\[(linkedin)app\]/i // LinkedIn App for iOS & Android
], [NAME], [
Expand Down
14 changes: 13 additions & 1 deletion test/specs/browser-all.json
Original file line number Diff line number Diff line change
Expand Up @@ -1693,7 +1693,19 @@
"ua" : "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.221 Safari/537.36 SE 2.X MetaSr 1.0",
"expect" :
{
"name" : "MetaSr"
"name" : "Sogou Explorer",
"version" : "1.0",
"major" : "1"
}
},
{
"desc" : "Sogou Mobile Browser",
"ua" : "Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_2 like Mac OS X) AppleWebKit/603.2.4 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30 SogouMSE,SogouMobileBrowser/3.7.4",
"expect" :
{
"name" : "Sogou Mobile",
"version" : "3.7.4",
"major" : "3"
}
},
{
Expand Down

0 comments on commit 69ed6ce

Please sign in to comment.