示例#1
0
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;
   }

}
示例#2
0
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);
   }
}
示例#3
0
bool
AccessCheck::isChrome(JSObject* obj)
{
    return isChrome(js::GetObjectCompartment(obj));
}