Bug 233073

Summary: REGRESSION: Version not included in UA
Product: WebKit Reporter: Teodor <teodor.atroshenko>
Component: WebCore Misc.Assignee: Nobody <webkit-unassigned>
Status: RESOLVED LATER    
Severity: Critical CC: mcatanzaro
Priority: P2    
Version: Safari 15   
Hardware: Unspecified   
OS: iOS 15   
Attachments:
Description Flags
iPhone XR with iOS 15.2 Beta none

Description Teodor 2021-11-12 15:18:27 PST
Created attachment 444114 [details]
iPhone XR with iOS 15.2 Beta

Starting with iOS 15.1 and continuing with iOS 15.2 Beta, there are issues with Version/X in User Agent string:

- WKWebView on iOS 15.1 omits "Version" from UA
ex. Mozilla/5.0 (iPhone; CPU iPhone OS 15_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 OptionalCustomUAString

- WKWebView on iOS 15.2 Beta omits "Version" from UA
ex. Mozilla/5.0 (iPhone; CPU iPhone OS 15_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 OptionalCustomUAString

- Safari on iOS 15.2 Beta uses "Version/15.1" in UA
ex. Mozilla/5.0 (iPhone; CPU iPhone OS 15_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.1 Mobile/15E148 Safari/604.1

Version is an integral part of Safari's UA and most, if not all, UA parser libraries don't assume that browser version is the same as iOS version, and thus report no browser version at all.
Using `bowser` (https://www.npmjs.com/package/bowser) as an example. If you load https://bowser-js.github.io/bowser-online/ in WKWebView on iOS 15.1 or 15.2 Beta, you will see that no `browser` version is parsed.
Comment 1 Michael Catanzaro 2021-11-12 15:46:23 PST
Could you show an example of the previous ("good") UA header, please?
Comment 2 Teodor 2021-11-12 17:19:21 PST
It seems that WKWebView never had "Version/X" in the UA string. Strangely this was not having an effect until the most recent release. Closing for now while I investigate this further.