bool isChromeOlderThan(const std::string& userAgent, double version) { if (isChrome(userAgent)) { boost::regex chromeRegEx("(?:Chrome|chromeframe)/(\\d{1,4})"); return !hasRequiredBrowserVersion(userAgent, chromeRegEx, version); } else { return false; } }
bool hasRequiredBrowser(const std::string& userAgent) { if (isChromeOlderThan(userAgent, 21)) return false; else if (isFirefoxOlderThan(userAgent, 10)) return false; else if (isSafariOlderThan(userAgent, 5.1)) return false; else if (isTridentOlderThan(userAgent, 6.0)) return false; else { return isChrome(userAgent) || isFirefox(userAgent) || isSafari(userAgent) || isTrident(userAgent); } }
bool AccessCheck::isChrome(JSObject* obj) { return isChrome(js::GetObjectCompartment(obj)); }