Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: e25f645b0f4d9e086caa93a0b1e345f049278708
https://github.com/WebKit/WebKit/commit/e25f645b0f4d9e086caa93a0b1e345f049278708
Author: John Cardullo <[email protected]>
Date: 2026-09-18 (Fri, 18 Sep 2026)
Changed paths:
M Source/WTF/wtf/PlatformGTK.cmake
M Source/WTF/wtf/PlatformWPE.cmake
R Source/WTF/wtf/glib/ChassisType.cpp
R Source/WTF/wtf/glib/ChassisType.h
M Source/WebCore/page/NavigatorUAData.cpp
M Source/WebCore/platform/UserAgent.h
M Source/WebCore/platform/glib/UserAgentGLib.cpp
M Source/WebCore/platform/glib/UserAgentQuirks.cpp
M Source/WebCore/platform/glib/UserAgentQuirks.h
M Source/WebKit/PlatformGTK.cmake
M Source/WebKit/PlatformWPE.cmake
M Source/WebKit/SourcesGTK.txt
M Source/WebKit/SourcesWPE.txt
M Source/WebKit/UIProcess/API/glib/WebKitAutocleanups.h.in
M Source/WebKit/UIProcess/API/glib/WebKitSettings.cpp
M Source/WebKit/UIProcess/API/glib/WebKitSettings.h.in
A Source/WebKit/UIProcess/API/glib/WebKitUserAgent.cpp
A Source/WebKit/UIProcess/API/glib/WebKitUserAgent.h.in
M Source/WebKit/UIProcess/API/glib/webkit.h.in
M Tools/TestWebKitAPI/Tests/WebCore/glib/UserAgentQuirks.cpp
M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/glib/TestWebKitSettings.cpp
A Tools/TestWebKitAPI/Tests/WebKit/WKWebView/glib/TestWebKitUserAgent.cpp
M Tools/TestWebKitAPI/glib/CMakeLists.txt
Log Message:
-----------
[GLib] Add WebKitUserAgent to configure and construct user agent strings
https://bugs.webkit.org/show_bug.cgi?id=218122
Reviewed by Carlos Garcia Campos and Michael Catanzaro.
Introduce WebKitUserAgent, an immutable boxed type that allows applications
to configure the user agent type (desktop or mobile) along with optional
application name and version, and generate standard user agent strings.
This separates user agent construction logic from WebKitSettings, making it
reusable for WebKitSettings as well as per-navigation WebKitWebsitePolicies.
Remove automatic chassis type detection and deprecate
webkit_settings_set_user_agent_with_application_details() in favor of
WebKitUserAgent.
Tests: Tools/TestWebKitAPI/Tests/WebCore/glib/UserAgentQuirks.cpp
Tools/TestWebKitAPI/Tests/WebKit/WKWebView/glib/TestWebKitSettings.cpp
Tools/TestWebKitAPI/Tests/WebKit/WKWebView/glib/TestWebKitUserAgent.cpp
* Source/WTF/wtf/PlatformGTK.cmake:
* Source/WTF/wtf/PlatformWPE.cmake:
* Source/WTF/wtf/glib/ChassisType.cpp: Removed.
* Source/WTF/wtf/glib/ChassisType.h: Removed.
* Source/WebCore/page/NavigatorUAData.cpp:
(WebCore::NavigatorUAData::mobile const):
* Source/WebCore/platform/UserAgent.h:
* Source/WebCore/platform/glib/UserAgentGLib.cpp:
(WebCore::isMobileUA):
(WebCore::platformForUAString):
(WebCore::platformVersionForUAString):
(WebCore::buildUserAgentString):
(WebCore::standardUserAgentStatic):
(WebCore::standardUserAgent):
(WebCore::standardUserAgentForURL):
* Source/WebCore/platform/glib/UserAgentQuirks.cpp:
(WebCore::urlRequiresMacintoshPlatform):
(WebCore::UserAgentQuirks::quirksForURL):
* Source/WebCore/platform/glib/UserAgentQuirks.h:
* Source/WebKit/PlatformGTK.cmake:
* Source/WebKit/PlatformWPE.cmake:
* Source/WebKit/SourcesGTK.txt:
* Source/WebKit/SourcesWPE.txt:
* Source/WebKit/UIProcess/API/glib/WebKitAutocleanups.h.in:
* Source/WebKit/UIProcess/API/glib/WebKitSettings.cpp:
(webkit_settings_class_init):
(webkit_settings_set_user_agent_with_application_details):
* Source/WebKit/UIProcess/API/glib/WebKitSettings.h.in:
* Source/WebKit/UIProcess/API/glib/WebKitUserAgent.cpp: Added.
(toWebCoreUserAgentType):
(webkit_user_agent_new):
(webkit_user_agent_new_with_application_details):
(webkit_user_agent_ref):
(webkit_user_agent_unref):
(webkit_user_agent_get_user_agent_type):
(webkit_user_agent_get_application_name):
(webkit_user_agent_get_application_version):
(webkit_user_agent_to_string):
* Source/WebKit/UIProcess/API/glib/WebKitUserAgent.h.in: Added.
* Source/WebKit/UIProcess/API/glib/webkit.h.in:
* Tools/TestWebKitAPI/Tests/WebCore/glib/UserAgentQuirks.cpp:
(TestWebKitAPI::assertUserAgentForURLHasChromeBrowserQuirk):
(TestWebKitAPI::assertUserAgentForURLHasFirefoxBrowserQuirk):
(TestWebKitAPI::assertUserAgentForURLHasMacPlatformQuirk):
(TestWebKitAPI::assertUserAgentForURLHasAndroidQuirk):
(TestWebKitAPI::assertUserAgentForURLHasEmptyQuirk):
(TestWebKitAPI::assertUserAgentForURLHasNoQuirk):
(TestWebKitAPI::TEST):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/glib/TestWebKitSettings.cpp:
(testWebKitSettingsUserAgent):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/glib/TestWebKitUserAgent.cpp:
Added.
(testWebKitUserAgentDefault):
(testWebKitUserAgentTypes):
(testWebKitUserAgentApplicationDetails):
(testWebKitUserAgentRefCopy):
(beforeAll):
* Tools/TestWebKitAPI/glib/CMakeLists.txt:
Canonical link: https://commits.webkit.org/321371@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications