Changeset 243525 in webkit
- Timestamp:
- Mar 26, 2019, 4:41:42 PM (7 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
-
ChangeLog (modified) (1 diff)
-
platform/UserAgent.h (modified) (1 diff)
-
platform/ios/UserAgentIOS.mm (modified) (1 diff)
-
platform/mac/UserAgentMac.mm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r243515 r243525 1 2019-03-26 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 [Cocoa] Refactor some helper functions for building UserAgent strings 4 https://bugs.webkit.org/show_bug.cgi?id=195990 5 6 Reviewed by Brent Fulgham. 7 8 Add an optional argument to standardUserAgentWithApplicationName to request the desktop version of the user 9 agent in Cocoa platforms. Work towards refactoring some codepaths to make the implementation of the "Request 10 Desktop Site" feature in Safari a bit more straightforward. 11 12 No change in behavior. 13 14 * platform/UserAgent.h: 15 * platform/ios/UserAgentIOS.mm: 16 (WebCore::standardUserAgentWithApplicationName): 17 18 The corresponding macOS version is currently hard-coded — the followup bug webkit.org/b/196275 tracks making 19 this dynamically fetch the paired macOS version when building for iOS. 20 21 * platform/mac/UserAgentMac.mm: 22 (WebCore::standardUserAgentWithApplicationName): 23 1 24 2019-03-26 Said Abou-Hallawa <said@apple.com> 2 25 -
trunk/Source/WebCore/platform/UserAgent.h
r243187 r243525 32 32 33 33 #if PLATFORM(COCOA) 34 WEBCORE_EXPORT String standardUserAgentWithApplicationName(const String& applicationName); 34 enum class UserAgentType { Default, Desktop }; 35 WEBCORE_EXPORT String standardUserAgentWithApplicationName(const String& applicationName, UserAgentType = UserAgentType::Default); 35 36 36 37 String systemMarketingVersionForUserAgentString(); -
trunk/Source/WebCore/platform/ios/UserAgentIOS.mm
r243187 r243525 77 77 } 78 78 79 String standardUserAgentWithApplicationName(const String& applicationName )79 String standardUserAgentWithApplicationName(const String& applicationName, UserAgentType type) 80 80 { 81 if (type == UserAgentType::Desktop) { 82 String appNameSuffix = applicationName.isEmpty() ? "" : makeString(" ", applicationName); 83 return makeString("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14) AppleWebKit/605.1.15 (KHTML, like Gecko)", appNameSuffix); 84 } 85 81 86 // FIXME: Is this needed any more? Mac doesn't have this check, 82 87 // Check to see if there is a user agent override for all WebKit clients. -
trunk/Source/WebCore/platform/mac/UserAgentMac.mm
r243187 r243525 33 33 namespace WebCore { 34 34 35 String standardUserAgentWithApplicationName(const String& applicationName )35 String standardUserAgentWithApplicationName(const String& applicationName, UserAgentType) 36 36 { 37 37 String osVersion = systemMarketingVersionForUserAgentString();
Note:
See TracChangeset
for help on using the changeset viewer.