Bug 249773 - [iOS] Add API for choosing applicationNameForUserAgent based on desktop/mobile mode
Summary: [iOS] Add API for choosing applicationNameForUserAgent based on desktop/mobil...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit API (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-12-22 06:57 PST by Ali Juma
Modified: 2022-12-23 03:22 PST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ali Juma 2022-12-22 06:57:21 PST
WKWebViewConfiguration's applicationNameForUserAgent only allows setting a single application name, that is used in both desktop and mobile mode when generating a user agent string.

However, this doesn't work for browsers (like Chrome on iOS) that want to use a different application name in desktop mode vs mobile mode.

Safari on iOS solves this problem using SPI to set the application name for desktop mode (-[WKWebPagePreferences _setApplicationNameForUserAgentWithModernCompatibility]), and non-Safari browsers would benefit from having API that achieves the same functionality.
Comment 1 Ali Juma 2022-12-22 06:57:56 PST
This is also filed as FB7428433.
Comment 2 Sam Sneddon [:gsnedders] 2022-12-23 03:22:05 PST
(In reply to Ali Juma from comment #1)
> This is also filed as FB7428433.

rdar://56905925