Skip to content

Commit 2882014

Browse files
committed
Add new inApp browser: Bing
1 parent 3eea064 commit 2882014

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

src/enums/ua-parser-enums.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const BrowserName = Object.freeze({
2020
AVG: 'AVG Secure Browser',
2121
BAIDU: 'Baidu Browser',
2222
BASILISK: 'Basilisk',
23+
BING: 'Bing',
2324
BLAZER: 'Blazer',
2425
BOLT: 'Bolt',
2526
BOWSER: 'Bowser',

src/main/ua-parser.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,7 @@
448448
/\b(line)\/([\w\.]+)\/iab/i, // Line App for Android
449449
/(alipay)client\/([\w\.]+)/i, // Alipay
450450
/(twitter)(?:and| f.+e\/([\w\.]+))/i, // Twitter
451+
/(bing)(?:web|sapphire)\/([\w\.]+)/i, // Bing
451452
/(instagram|snapchat|klarna)[\/ ]([-\w\.]+)/i // Instagram/Snapchat/Klarna
452453
], [NAME, VERSION, [TYPE, INAPP]], [
453454
/\bgsa\/([\w\.]+) .*safari\//i // Google Search Appliance on iOS

test/data/ua/browser/browser-all.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,26 @@
271271
"major" : "11"
272272
}
273273
},
274+
{
275+
"desc" : "Bing",
276+
"ua" : "Mozilla/5.0 (iPhone; CPU iPhone OS 18_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.5 Mobile/15E148 Safari/605.1.15 BingSapphire/31.8.430522001",
277+
"expect" :
278+
{
279+
"name" : "Bing",
280+
"version" : "31.8.430522001",
281+
"major" : "31"
282+
}
283+
},
284+
{
285+
"desc" : "Bing",
286+
"ua" : "Mozilla/5.0 (Linux; Android 9; MIX 2 Build/PKQ1.190118.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/100.0.4893.0 Mobile Safari/537.36 BingWeb/6.9.12",
287+
"expect" :
288+
{
289+
"name" : "Bing",
290+
"version" : "6.9.12",
291+
"major" : "6"
292+
}
293+
},
274294
{
275295
"desc" : "Blazer",
276296
"ua" : "Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; PalmSource/hspr-H102; Blazer/4.0) 16;320x320",

0 commit comments

Comments
 (0)