UserAgentQuirks UserAgentQuirks::quirksForURL(const URL& url) { ASSERT(!url.isNull()); UserAgentQuirks quirks; if (urlRequiresChromeBrowser(url)) quirks.add(UserAgentQuirks::NeedsChromeBrowser); if (urlRequiresMacintoshPlatform(url)) quirks.add(UserAgentQuirks::NeedsMacintoshPlatform); return quirks; }
String standardUserAgentForURL(const URL& url) { ASSERT(!url.isNull()); UserAgentQuirks quirks; if (url.host().endsWith(".yahoo.com")) { // www.yahoo.com redirects to the mobile version when Linux is present in the UA, // use always Macintosh as platform. See https://bugs.webkit.org/show_bug.cgi?id=125444. quirks.add(UserAgentQuirks::NeedsMacintoshPlatform); } // The null string means we don't need a specific UA for the given URL. return quirks.isEmpty() ? String() : buildUserAgentString(quirks); }