[Webkit-unassigned] [Bug 278284] New: WKWebView version not available in API and not included in user agent for macOS

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Aug 17 18:02:14 PDT 2024


https://bugs.webkit.org/show_bug.cgi?id=278284

            Bug ID: 278284
           Summary: WKWebView version not available in API and not
                    included in user agent for macOS
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: All
                OS: All
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebKit API
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: steverep+webkit at gmail.com

Currently there is no way for app authors to determine the Safari version being used by a WKWebView.  It is also not included in the default user agent string for macOS (i.e. the string set by the contentMode before before appending the applicationNameForUserAgent).  On iPhone or iPad, this is not an issue since the Safari version matches the OS version, which is included in the string.

The current user agent string looks like:

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) <applicationNameForUserAgent>

The WebKit version there is old and frozen.  There is no useful information for clients to use in that string, and there is no way for applications to add the useful Safari version for clients.  I understand that user agent strings are a contentious topic, but it seems like a correction is warranted here until some version of the client hints API is widely supported.

My proposed solution would be:
1. Make the version available to app authors, perhaps as a static string on the WKWebView class (preferably as a user-friendly Safari version).
2. When the contentMode is desktop (either on macOS or pretending to be from an iPad), add the appropriate tokens to the default string to identify the Safari version as would be done by the browser (e.g. "Version/17.5 Safari/<webkit-version>").

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20240818/39aa0a85/attachment.htm>


More information about the webkit-unassigned mailing list