Determine if the browser is Firefox or not (last updated 1.7)
@return boolean True if the browser is Firefox otherwise false
190732
protected function checkBrowserFirefox()
    {
        if (stripos($this->_agent, 'safari') === false) {
            if (preg_match("/Firefox[\/ \(]([^ ;\)]+)/i", $this->_agent, $matches)) {
                $this->setVersion($matches[1]);
                $this->setBrowser(self::BROWSER_FIREFOX);

                return true;
            } elseif (preg_match("/Firefox$/i", $this->_agent, $matches)) {
                $this->setVersion("");
                $this->setBrowser(self::BROWSER_FIREFOX);

                return true;
            }
        }

        return false;
    }
22050
private function isChrome()
  {
    $is = false;
    // For our purposes, Chrome and Chromium are the same.
    if ( preg_match( "/(Chrome|Chromium)\/([0-9\.]+)/", $this->ua, $matches ) )
    {
      // These things go around acting like they are chrome, but they aren't.
      if ( !preg_match( "/(MRCHROME|FlyFlow|baidubrowser|bot|Edge)/i", $this->ua ) )
      {
        $is = true;
        $version = $matches[ 2 ];
        $parts = explode( '.', $matches[ 2 ] );
        $major = array_shift($parts);
        $minor = array_shift($parts);
        $rev = implode( '.', $parts );
      }
    }

    if ( $is && isset($version,$major,$minor,$rev) )
    {
      $this->browser = 'chrome';
      $this->version = $version;
      $this->major = $major;
      $this->minor = $minor;
      $this->rev = $rev;

      return true;
    }

    return false;
  }
1030971
protected function checkBrowserChrome() {
	    if( stripos($this->_agent,'Chrome') !== false ) {
		    $aresult = explode('/',stristr($this->_agent,'Chrome'));
		    $aversion = explode(' ',$aresult[1]);
		    $this->setVersion($aversion[0]);
		    $this->setBrowser(self::BROWSER_CHROME);
		    return true;
	    }
	    return false;
    }
264410
protected function checkBrowserNetscapeNavigator9Plus()
    {
        if (stripos($this->_agent, 'Firefox') !== false && preg_match('/Navigator\/([^ ]*)/i', $this->_agent,
                $matches)
        ) {
            $this->setVersion($matches[1]);
            $this->setBrowser(self::BROWSER_NETSCAPE_NAVIGATOR);
            return true;
        } else {
            if (stripos($this->_agent, 'Firefox') === false && preg_match('/Netscape6?\/([^ ]*)/i', $this->_agent,
                    $matches)
            ) {
                $this->setVersion($matches[1]);
                $this->setBrowser(self::BROWSER_NETSCAPE_NAVIGATOR);
                return true;
            }
        }
        return false;
    }
594235
protected function checkBrowserMSNBot()
    {
        if (stripos($this->_agent, "msnbot") !== false) {
            $aresult = explode("/", stristr($this->_agent, "msnbot"));
            $aversion = explode(" ", $aresult[1]);
            $this->setVersion(str_replace(";", "", $aversion[0]));
            $this->_browser_name = self::BROWSER_MSNBOT;
            $this->setRobot(true);

            return true;
        }

        return false;
    }
294944
public static function checkBrowserBAIDU(){
		if (stripos(self::$userAgentString, 'BIDUBrowser') !== false) {
			$aresult = explode('/', stristr(self::$userAgentString, 'BIDUBrowser') );
			if (isset($aresult[1])) {
				$aversion = explode(' ', $aresult[1]);
				self::$browser->setVersion($aversion[0]);
			}
			self::$browser->setName(Browser::BAIDU);
			return true;
		}

		return false;
	}
331844
protected function checkBrowserAndroid()
    {
        if (stripos($this->_agent, 'Android') !== false) {
            $aresult = explode(' ', stristr($this->_agent, 'Android'));
            if (isset($aresult[1])) {
                $aversion = explode(' ', $aresult[1]);
                $this->setVersion($aversion[0]);
            } else {
                $this->setVersion(self::VERSION_UNKNOWN);
            }
            if (stripos($this->_agent, 'Mobile') !== false) {
                $this->setMobile(true);
            } else {
                $this->setTablet(true);
            }
            $this->setBrowser(self::BROWSER_ANDROID);
            return true;
        }
        return false;
    }
623576
protected function checkBrowserSlurp()
    {
        if (stripos($this->_agent, 'slurp') !== false) {
            $aresult = explode('/', stristr($this->_agent, 'Slurp'));
            if (isset($aresult[1])) {
                $aversion = explode(' ', $aresult[1]);
                $this->setVersion($aversion[0]);
                $this->_browser_name = self::BROWSER_SLURP;
                $this->setRobot(true);
                $this->setMobile(false);
                return true;
            }
        }
        return false;
    }
667182
public static function checkBrowserLynx()
    {
        if (stripos(self::$userAgentString, 'lynx') !== false) {
            $aresult = explode('/', stristr(self::$userAgentString, 'Lynx'));
            $aversion = explode(' ', (isset($aresult[1]) ? $aresult[1] : ''));
            self::$browser->setVersion($aversion[0]);
            self::$browser->setName(Browser::LYNX);

            return true;
        }

        return false;
    }
645890
public static function checkBrowserOmniWeb()
    {
        if (stripos(self::$userAgentString, 'omniweb') !== false) {
            $aresult = explode('/', stristr(self::$userAgentString, 'omniweb'));
            $aversion = explode(' ', isset($aresult[1]) ? $aresult[1] : '');
            self::$browser->setVersion($aversion[0]);
            self::$browser->setName(Browser::OMNIWEB);

            return true;
        }

        return false;
    }
1112054
protected function checkBrowserQtWebBrowser() {
        if( stripos($this->_agent,'QtWebEngine') !== false ) {
            $aresult  = explode('/',stristr($this->_agent,'QtWebEngine'));
            $aversion = explode('.',$aresult[1]);
            $this->setVersion($aversion[0]);
            $this->setBrowser(self::BROWSER_QTWEB);
            return true;
        }
        return false;
    }
511125
function DetectFirefoxOSTablet()
   {
   	  //First, let's make sure we're NOT on another major mobile OS.
   	  if ($this->DetectIos() == $this->true 
   	  	|| $this->DetectAndroid() == $this->true
   	  	|| $this->DetectSailfish() == $this->true)
         return $this->false;    	  
   
      if ((stripos($this->useragent, $this->engineFirefox) > -1) &&
		(stripos($this->useragent, $this->deviceTablet) > -1))
         return $this->true;
            
      return $this->false; 
   }
543383
protected function checkBrowserFirebird()
    {
        if (stripos($this->_agent, 'Firebird') !== false) {
            $aversion = explode('/', stristr($this->_agent, 'Firebird'));
            if (isset($aversion[1])) {
                $this->setVersion($aversion[1]);
                $this->setBrowser(self::BROWSER_FIREBIRD);
                return true;
            }
        }
        return false;
    }
372770
protected function checkBrowsers()
    {
        return (
            // well-known, well-used
            // Special Notes:
            // (1) Opera must be checked before FireFox due to the odd
            //     user agents used in some older versions of Opera
            // (2) WebTV is strapped onto Internet Explorer so we must
            //     check for WebTV before IE
            // (3) (deprecated) Galeon is based on Firefox and needs to be
            //     tested before Firefox is tested
            // (4) OmniWeb is based on Safari so OmniWeb check must occur
            //     before Safari
            // (5) Netscape 9+ is based on Firefox so Netscape checks
            //     before FireFox are necessary
            // (6) Vivalid is UA contains both Firefox and Chrome so Vivalid checks
            //     before Firefox and Chrome
            $this->checkBrowserWebTv() ||
            $this->checkBrowserEdge() ||
            $this->checkBrowserInternetExplorer() ||
            $this->checkBrowserOpera() ||
            $this->checkBrowserGaleon() ||
            $this->checkBrowserNetscapeNavigator9Plus() ||
            $this->checkBrowserVivaldi() ||
            $this->checkBrowserYandex() ||
            $this->checkBrowserFirefox() ||
            $this->checkBrowserChrome() ||
            $this->checkBrowserOmniWeb() ||

            // common mobile
            $this->checkBrowserAndroid() ||
            $this->checkBrowseriPad() ||
            $this->checkBrowseriPod() ||
            $this->checkBrowseriPhone() ||
            $this->checkBrowserBlackBerry() ||
            $this->checkBrowserNokia() ||

            // common bots
            $this->checkBrowserGoogleBot() ||
            $this->checkBrowserMSNBot() ||
            $this->checkBrowserBingBot() ||
            $this->checkBrowserSlurp() ||

            // Yandex bots
            $this->checkBrowserYandexBot() ||
            $this->checkBrowserYandexImageResizerBot() ||
            $this->checkBrowserYandexBlogsBot() ||
            $this->checkBrowserYandexCatalogBot() ||
            $this->checkBrowserYandexDirectBot() ||
            $this->checkBrowserYandexFaviconsBot() ||
            $this->checkBrowserYandexImagesBot() ||
            $this->checkBrowserYandexMediaBot() ||
            $this->checkBrowserYandexMetrikaBot() ||
            $this->checkBrowserYandexNewsBot() ||
            $this->checkBrowserYandexVideoBot() ||
            $this->checkBrowserYandexWebmasterBot() ||

            // check for facebook external hit when loading URL
            $this->checkFacebookExternalHit() ||

            // WebKit base check (post mobile and others)
            $this->checkBrowserSamsung() ||
            $this->checkBrowserSilk() ||
            $this->checkBrowserSafari() ||

            // everyone else
            $this->checkBrowserNetPositive() ||
            $this->checkBrowserFirebird() ||
            $this->checkBrowserKonqueror() ||
            $this->checkBrowserIcab() ||
            $this->checkBrowserPhoenix() ||
            $this->checkBrowserAmaya() ||
            $this->checkBrowserLynx() ||
            $this->checkBrowserShiretoko() ||
            $this->checkBrowserIceCat() ||
            $this->checkBrowserIceweasel() ||
            $this->checkBrowserW3CValidator() ||
            $this->checkBrowserPlayStation() ||
            $this->checkBrowserIframely() ||
            $this->checkBrowserCocoa() ||
            $this->checkBrowserMozilla() /* Mozilla is such an open standard that you must check it last */
        );
    }
1061065
protected function checkBrowserNokia()
    {
        if ($this->containString($this->_agent, array('Nokia5800', 'Nokia5530', 'Nokia5230'), true, false)) {
            $this->setBrowser(self::BROWSER_NOKIA);
            $this->setVersion('7.0');
            $this->setMobile(true);
            $this->setRobot(false);

            return true;
        }

        if ($this->checkSimpleBrowserUA(array('NokiaBrowser', 'BrowserNG', 'Series60', 'S60', 'S40OviBrowser'), $this->_agent, self::BROWSER_NOKIA, true)) {
            return true;
        }

        return false;
    }
810342
public static function checkBrowserSamsung()
    {
        if (stripos(self::$userAgentString, 'SamsungBrowser') !== false) {
            $aresult = explode('/', stristr(self::$userAgentString, 'SamsungBrowser'));
            if (isset($aresult[1])) {
                $aversion = explode(' ', $aresult[1]);
                self::$browser->setVersion($aversion[0]);
            }
            self::$browser->setName(Browser::SAMSUNG_BROWSER);

            return true;
        }

        return false;
    }
33350
protected function checkBrowsers() {
		return (
			// well-known, well-used
			// Special Notes:
			// (1) Opera must be checked before FireFox due to the odd
			//     user agents used in some older versions of Opera
			// (2) WebTV is strapped onto Internet Explorer so we must
			//     check for WebTV before IE
			// (3) (deprecated) Galeon is based on Firefox and needs to be
			//     tested before Firefox is tested
			// (4) OmniWeb is based on Safari so OmniWeb check must occur
			//     before Safari
			// (5) Netscape 9+ is based on Firefox so Netscape checks
			//     before FireFox are necessary
			$this->checkBrowserWebTv() ||
		    $this->checkBrowserMaxthon()    ||  //add BugBuster, must be before IE, (Dual Engine: Webkit and Trident)
			$this->checkBrowserInternetExplorer() ||
			$this->checkBrowserGaleon() ||
			$this->checkBrowserNetscapeNavigator9Plus() ||
			$this->checkBrowserFirefox()    ||
			$this->checkBrowserSongbird()   ||	//add BugBuster
			$this->checkBrowserSeaMonkey()  ||	//add BugBuster
			$this->checkBrowserChromePlus() ||	//add BugBuster
		    $this->checkBrowserCoolNovo()   ||	//add BugBuster
		    $this->checkBrowserVivaldi()    ||  //add BugBuster
		    $this->checkBrowserDooble()     ||  //add BugBuster
		    $this->checkBrowserQtWebBrowser() || //add BugBuster
			
			$this->checkBrowserOmniWeb() ||

			// common mobile
			$this->checkBrowserAndroidSamsungGalaxy() ||  //add BugBuster
			$this->checkBrowserAndroidHTCDesire() ||      //add BugBuster
			$this->checkBrowserAndroidHTCMagic() ||       //add BugBuster
			$this->checkBrowserAndroidHTCSensation() ||   //add BugBuster
			$this->checkBrowserAndroidHTCNexusOne() ||    //add BugBuster
			$this->checkBrowserAndroidHTCWildfire() ||    //add BugBuster
			$this->checkBrowserAndroidAcerA500() ||       //add BugBuster
			$this->checkBrowserAndroidAcerA501() ||       //add BugBuster
			$this->checkBrowserAndroidSamsungNexusS()  || //add BugBuster
			$this->checkBrowserAndroidThinkPadTablet() || //add BugBuster
			$this->checkBrowserAndroidXoomTablet()     || //add BugBuster
			$this->checkBrowserAndroidAsusTransfomerPad() || //add BugBuster
			$this->checkBrowserAndroidKindleFire() ||      //add BugBuster

			//at last Android only!
			$this->checkBrowserAndroid() ||

			$this->checkBrowseriPad() ||
			$this->checkBrowseriPod() ||
			$this->checkBrowseriPhone() ||
			$this->checkBrowserBlackBerry() ||
			$this->checkBrowserNokia() ||

			// common bots
			//$this->checkBrowserGoogleBot() ||
			//$this->checkBrowserMSNBot() ||
			//$this->checkBrowserSlurp() ||
		    // chrome post Android Pads
		    $this->checkBrowserChrome() ||
			// WebKit base check (post mobile and others)
			$this->checkBrowserSafari() ||
			// Opera Mini must check post mobile
			$this->checkBrowserOpera() ||
				
			// everyone else
			$this->checkBrowserTOnline() ||
			$this->checkBrowserNetPositive() ||
			$this->checkBrowserFirebird() ||
			$this->checkBrowserKonqueror() ||
			$this->checkBrowserIcab() ||
			$this->checkBrowserPhoenix() ||
			$this->checkBrowserAmaya() ||
			$this->checkBrowserLynx() ||
			$this->checkBrowserShiretoko() ||
			$this->checkBrowserIceCat() ||
			//$this->checkBrowserW3CValidator() ||
			$this->checkBrowserIceweasel() || //why not?; BugBuster
			$this->checkBrowserHTTPRequest2() || // add BugBuster
			$this->checkBrowserMozilla() /* Mozilla is such an open standard that you must check it last */
		);
    }