bowser-js / bowser

a browser detector
Other
5.46k stars 483 forks source link

Edge on iOS and Edge on Android #201

Closed everget closed 6 years ago

everget commented 6 years ago

@lancedikson Hi, Denis

bowser version: 1.8.0

1) window.navigator.userAgent of the browser is: Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_2 like Mac OS X) AppleWebKit/603.2.4 (KHTML, like Gecko) Mobile/14F89 Safari/603.2.4 EdgiOS/41.1.35.1 And it's detected like a Safari But real name of the browser is Microsoft Edge

bowser._detect('Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_2 like Mac OS X) AppleWebKit/603.2.4 (KHTML, like Gecko) Mobile/14F89 Safari/603.2.4 EdgiOS/41.1.35.1')
// =>
// {
//   name: 'Safari',
//   safari: true,
//   webkit: true,
//   iphone: true,
//   ios: true,
//   osversion: '10.3.2',
//   mobile: true,
//   a: true
// }

2) window.navigator.userAgent of the browser is: Mozilla/5.0 (Linux; Android 8.0; Pixel XL Build/OPP3.170518.006) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.0 Mobile Safari/537.36 EdgA/41.1.35.1 And it's detected like a Chrome But real name of the browser is Microsoft Edge

bowser._detect('Mozilla/5.0 (Linux; Android 8.0; Pixel XL Build/OPP3.170518.006) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.0 Mobile Safari/537.36 EdgA/41.1.35.1')
// =>
// {
//   name: 'Chrome',
//   chrome: true,
//   version: '58.0',
//   blink: true,
//   android: true,
//   osversion: '8.0',
//   mobile: true,
//   a: true
// }

Docs: https://blogs.windows.com/msedgedev/2017/10/05/microsoft-edge-ios-android-developer/

Possible solution:

/edg([ea]|ios)/i.test(ua)
lancedikson commented 6 years ago

Hey, @everget! Thanks for your report with explicit description. This would be super cool if you had time and wish to make the PR fixing this :) If not, I'll take care of it soon.

lancedikson commented 6 years ago

@everget, also I've noticed that you're developing rowser. It seems very cool and don't you mind to implement some of the features (like case-insensitive methods or so) to bowser? I've been developing a totally new version of bowser for some time and it's supposed to have a better API, then it has now. You can check the thing in the v2 branch. Feel free to ping me anytime if you want to participate in development here :)

everget commented 6 years ago

@lancedikson Hi, okay) 1) I will try to make PR for Edge this week 2) I will look at v2 branch

lancedikson commented 6 years ago

Fine 👍 Thanks

lancedikson commented 6 years ago

The fix has been released as 1.8.1. Thanks, @everget!