コード例 #1
0
ファイル: UserAgentQuirks.cpp プロジェクト: eocanha/webkit
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;
}
コード例 #2
0
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);
}