Safari on iOS 14 is being detected as iOS 11
See original GitHub issueWhat
We have noticed that when using Safari on an iPhone 12 on iOS 14, fetch
(among other things) is being polyfilled when it doesn’t need to. This has caused some unexpected issues with some DataDog client-side JavaScript we are using.
Details
To reproduce
- Using Chrome’s dev tools, set the User Agent String to:
Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.1 Mobile/15E148 Safari/604.1
- Go to the following polyfil.io URL: https://polyfill.io/v3/polyfill.min.js?features=es2017%2Ces2016%2Ces2015%2Cdefault%2CArray.prototype.contains%2CDOMTokenList.prototype.%40%40iterator%2CDocumentFragment%2CEventSource%2CFunction.name%2CIntersectionObserver%2CMutationObserver%2CNodeList.prototype.%40%40iterator%2CObject.freeze%2CPromise.prototype.finally%2CString.fromCodePoint%2CString.prototype.contains%2CUserTiming%2CWebAnimations%2Cfetch%2ClocalStorage%2CmatchMedia%2Cnavigator.sendBeacon%2Cperformance.now%2Cscreen.orientation%2CsetImmediate%2CResizeObserver%2CAbortController%2CIntl.PluralRules,Intl.PluralRules.~locale.en
- Go to the Network Tab in Dev Tools.
This can also be reproduced simulating an iPhone 12 on iOS 14 using Simulator on a Mac or using BrowserStack.
Expected result
- The response should not contain any code for polyfilling
fetch
- The
detected-user-agent
response header should have a value likeMobile Safari/WKWebView/14..
- The
normalized-user-agent
response header should have a value likeios_saf/14.0.3
Actual result
- The response contains code for polyfilling
fetch
- The
detected-user-agent
response header has the valueMobile Safari/WKWebView/11..
- The
normalized-user-agent
response header has a value ofios_saf/11.0.0
The following screen grab shows the above result:
Additional information
I believe the good work done in https://github.com/Financial-Times/useragent_parser/pull/101 should have fixed it, and when running the service locally it works as expected. Is it possible that there’s a cache that needs clearing?
Issue Analytics
- State:
- Created 2 years ago
- Comments:8
Top Results From Across the Web
If Safari isn't loading websites or quits on your iPhone, iPad, or ...
Go to Settings > Safari. · Tap Clear History and Website Data. · Tap Clear History and Data to confirm.
Read more >If your computer doesn't recognize your iPhone or iPad
* This feature depends on a settting: From the menu bar in the Finder, choose Finder > Settings (or Preferences). Click Sidebar at...
Read more >Xcode does not recognize iphone | Apple Developer Forums
Xcode 9.4.1 on MacOS 10.13.6 does not recognize iphone (iOS 11.4.1), hence "No devices connected to 'My Mac'". Even Window -> Devices and...
Read more >If your iPhone or iPad won't update - Apple Support
Go to Settings > General > Software Update and download the latest update. If you can't see the update in the list of...
Read more >Browse the web using Safari on iPhone - Apple Support
In Safari on iPhone, view websites, preview website links, translate webpages, and add the Safari app back to your Home Screen.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Apologies, it has yet to be released to production - I will do that today
maybe related to https://github.com/Financial-Times/polyfill-useragent-normaliser/issues/175