DamonOehlman / detect-browser

Unpack a browser type and version from the useragent string
MIT License
687 stars 102 forks source link

Facebook browser on iOS #168

Closed kyrsquir closed 3 years ago

kyrsquir commented 3 years ago

Current Facebook browser regex doesn't seem to correctly handle iOS case:

Sample user agents:

Android Facebook browser: Mozilla/5.0 (Linux; Android 10; ONEPLUS A6000 Build/QKQ1.190716.003; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/93.0.4577.82 Mobile Safari/537.36 [FB_IAB/FB4A;FBAV/335.0.0.28.118;]

iOS Facebook browser: Mozilla/5.0 (iPhone; CPU iPhone OS 14_4_1 like Mac OS X) WebKit/8610 (KHTML, like Gecko) Mobile/18D61 [FBAN/FBIOS;FBDV/iPhone8,4;FBMD/iPhone;FBSN/iOS;FBSV/14.4.1;FBSS/2;FBID/phone;FBLC/ru_RU;FBOP/5]

Not sure which part of the iOS string is the version, please correct me if I made a wrong call with FBSV/14.4.1.

DamonOehlman commented 3 years ago

@kyrsquir Thanks heaps for this. I'm sure a lot of people will be happy to see this resolved. I'll merge the PR in and do a release.

DamonOehlman commented 3 years ago

And done - 5.2.1