question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Safari on iOS 14 is being detected as iOS 11

See original GitHub issue

What

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

  1. 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
  2. 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
  3. 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 like Mobile Safari/WKWebView/14..
  • The normalized-user-agent response header should have a value like ios_saf/14.0.3

Actual result

  • The response contains code for polyfilling fetch
  • The detected-user-agent response header has the value Mobile Safari/WKWebView/11..
  • The normalized-user-agent response header has a value of ios_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:closed
  • Created 2 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
JakeChampioncommented, Feb 24, 2022

Apologies, it has yet to be released to production - I will do that today

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found