// Be careful with this quirk: it's an invitation for sites to use JavaScript // that works in Chrome that WebKit cannot handle. Prefer other quirks instead. static bool urlRequiresChromeBrowser(const URL& url) { String baseDomain = topPrivatelyControlledDomain(url.host()); // Needed for fonts on many sites to work with WebKit. // https://bugs.webkit.org/show_bug.cgi?id=147296 if (baseDomain == "typekit.net" || baseDomain == "typekit.com") return true; // Shut off Chrome ads. Avoid missing features on maps.google.com. Avoid // receiving a terrible fallback version of calendar.google.com. Receive a // fancier plus.google.com. if (baseDomain.startsWith("google.")) return true; // Needed for YouTube 360 with WebKitGTK+ and WPE (requires ENABLE_MEDIA_SOURCE). if (baseDomain == "youtube.com") return true; // Slack completely blocks users with WebKitGTK+'s standard user agent. if (baseDomain == "slack.com") return true; return false; }
String cookieStoragePartition(const URL& firstPartyForCookies, const URL& resource) { if (!cookieStoragePartitioningEnabled) return emptyString(); String firstPartyDomain = firstPartyForCookies.host(); #if ENABLE(PUBLIC_SUFFIX_LIST) firstPartyDomain = topPrivatelyControlledDomain(firstPartyDomain); #endif return hostIsInDomain(resource.host(), firstPartyDomain) ? emptyString() : firstPartyDomain; }
String ResourceRequest::partitionName(const String& domain) { if (domain.isNull()) return emptyString(); #if ENABLE(PUBLIC_SUFFIX_LIST) String highLevel = topPrivatelyControlledDomain(domain); if (highLevel.isNull()) return emptyString(); return highLevel; #else return domain; #endif }
static bool urlRequiresMacintoshPlatform(const URL& url) { String baseDomain = topPrivatelyControlledDomain(url.host()); // At least finance.yahoo.com displays a mobile version with WebKitGTK+'s standard user agent. if (baseDomain == "yahoo.com") return true; // taobao.com displays a mobile version with WebKitGTK+'s standard user agent. if (baseDomain == "taobao.com") return true; // web.whatsapp.com completely blocks users with WebKitGTK+'s standard user agent. if (baseDomain == "whatsapp.com") return true; return false; }