Skip to content

Commit

Permalink
Cherry-pick 274711@main (2d4541e). https://bugs.webkit.org/show_bug.c…
Browse files Browse the repository at this point in the history
…gi?id=269211

    Scope the UA override to www.apple.com/apple-events
    https://bugs.webkit.org/show_bug.cgi?id=269211

    Reviewed by Michael Catanzaro.

    A quirk has been introduced in 265206@main (e0b0d3b) to use a
    Chrome user-agent override for apple.com. Limit this to www.apple.com,
    so that it does not apply to tv.apple.com (and its custom subdomains).

    Otherwise, custom user-agents can not be used for Apple TV+ (rdar://122408473).

    https://apple.com/apple-events/ redirects to
    https://www.apple.com/apple-events/, so the quirk will still apply to both.

    * Source/WebCore/platform/glib/UserAgentQuirks.cpp:
    (WebCore::urlRequiresChromeBrowser):
    * Tools/TestWebKitAPI/Tests/WebCore/UserAgentQuirks.cpp:
    (TestWebKitAPI::TEST):

    Canonical link: https://commits.webkit.org/274711@main
  • Loading branch information
blino authored and aperezdc committed Mar 8, 2024
1 parent 9c058fc commit da1ba74
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Source/WebCore/platform/glib/UserAgentQuirks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ static bool urlRequiresChromeBrowser(const String& domain, const String& baseDom
return true;

// https://webcompat.com/issues/123672
if (baseDomain == "apple.com"_s)
if (domain == "www.apple.com"_s)
return true;

return false;
Expand Down
2 changes: 1 addition & 1 deletion Tools/TestWebKitAPI/Tests/WebCore/UserAgentQuirks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ TEST(UserAgentTest, Quirks)
assertUserAgentForURLHasChromeBrowserQuirk("http://bankofamerica.com/");
assertUserAgentForURLHasChromeBrowserQuirk("http://soundcloud.com/");
assertUserAgentForURLHasChromeBrowserQuirk("http://youtube.com/");
assertUserAgentForURLHasChromeBrowserQuirk("http://apple.com/");
assertUserAgentForURLHasChromeBrowserQuirk("http://www.apple.com/");

assertUserAgentForURLHasFirefoxBrowserQuirk("http://bugzilla.redhat.com/");

Expand Down

0 comments on commit da1ba74

Please sign in to comment.