Temasys / SkylinkJS

SkylinkJS Javascript WebRTC SDK
http://skylink.io/web
Other
275 stars 57 forks source link

Fix Chrome iOS new UA string. #467

Closed NicolasBonduel closed 2 years ago

NicolasBonduel commented 3 years ago

Chrome changed their user agent string, and the regexp you use breaks it.

The error is the following: null is not an object (evaluating 'iOSVersion[0]') It is triggered here: https://github.com/Temasys/SkylinkJS/blob/2.x.x/master/src/adapter.js#L143 The new user agent string is: Mozilla/5.0 (iPhone; CPU iPhone OS 14_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/92.0.4515.0 Mobile/15E148 Safari/604.1 This new regex would work: CPU(?> iPhone| iPad)? OS ([0-9]+)_([0-9]+)