| line | true | false | branch | 
 
| 493 | 2 | 7245 | unless (defined $user_agent) | 
 
| 497 | 7245 | 2 | defined $user_agent ? : | 
 
| 522 | 5512 | 45120 | unless $self->{'os_tests'} | 
 
| 546 | 5761 | 24913 | unless $self->{'robot_tests'} | 
 
| 559 | 4464 | 19898 | unless $self->{'version_tests'} | 
 
| 569 | 7247 | 15088 | unless $self->{'device_tests'} | 
 
| 576 | 0 | 1 | if (defined $user_agent) { } | 
 
| 648 | 30 | 7217 | if ($ua =~ m[edge/([\d\.]+)]) { } | 
 
|  | 944 | 6273 | elsif ($ua =~ m[trident/([\w\.\d]*)]) { } | 
 
|  | 732 | 5541 | elsif (index($ua, 'gecko') != -1 and index($ua, 'like gecko') == -1) { } | 
 
|  | 2628 | 2913 | elsif ($ua =~ m[applewebkit/([\d.\+]+)] and not $tests->{'edgehtml'}) { } | 
 
|  | 138 | 2775 | elsif ($ua =~ m[presto/([\d.]+)]) { } | 
 
|  | 12 | 2763 | elsif ($ua =~ m[khtml/([\d.]+)]) { } | 
 
| 659 | 660 | 72 | if ($ua =~ /\([^)]*rv:([\w.\d]*)/) | 
 
| 678 | 12 | 7235 | if (index($ua, 'galeon') != -1) { } | 
 
|  | 6 | 7229 | elsif (index($ua, 'epiphany') != -1) { } | 
 
|  | 24 | 7205 | elsif ($ua =~ m[(?:edg|edga|edgios)/[\d.]+]) { } | 
 
|  | 30 | 7175 | elsif ($ua =~ m[edge/[\d.]+]) { } | 
 
|  | 636 | 6539 | elsif ($ua =~ m[
                (firebird|iceweasel|phoenix|namoroka|firefox|fxios)
                \/
                ( [^.]* )           # Major version number is everything before first dot
                \.                  # The first dot
                ( [\d]* )           # Minor version nnumber is digits after first dot
            ]ox and index($ua, 'not firefox') == -1) { } | 
 
|  | 78 | 6461 | elsif ($self->{'user_agent'} =~ / \[ FB (?: AN | _IAB ) /x) { } | 
 
|  | 264 | 6197 | elsif ($ua =~ m[opera|opr\/]) { } | 
 
|  | 1730 | 4467 | elsif ($tests->{'trident'} or index($ua, 'msie') != -1 or index($ua, 'microsoft internet explorer') != -1) { } | 
 
|  | 12 | 4455 | elsif (0 < index($self->{'user_agent'}, ' Instagram ')) { } | 
 
|  | 12 | 4443 | elsif (index($ua, 'brave') != -1) { } | 
 
|  | 72 | 4371 | elsif (index($ua, 'silk') != -1) { } | 
 
|  | 6 | 4365 | elsif (index($ua, 'samsungbrowser') != -1) { } | 
 
|  | 336 | 4029 | elsif (index($ua, 'ucbrowser') != -1) { } | 
 
|  | 36 | 3993 | elsif (0 < index($self->{'user_agent'}, ' YaBrowser/')) { } | 
 
|  | 1344 | 2649 | elsif (index($ua, 'chrome/') != -1 or index($ua, 'crios') != -1) { } | 
 
|  | 42 | 2607 | elsif (index($ua, 'blackberry') != -1 or index($ua, 'bb10') != -1 or index($ua, 'rim tablet os') != -1) { } | 
 
|  | 960 | 1647 | elsif (index($ua, 'safari') != -1 or index($ua, 'applewebkit') != -1) { } | 
 
|  | 0 | 1647 | elsif (index($ua, 'neoplanet') != -1) { } | 
 
|  | 0 | 1647 | elsif (index($ua, 'webtv') != -1) { } | 
 
|  | 6 | 1641 | elsif (index($ua, 'nintendo 3ds') != -1) { } | 
 
|  | 0 | 1641 | elsif (index($ua, 'nintendo dsi') != -1) { } | 
 
|  | 42 | 1599 | elsif (index($ua, 'playstation 3') != -1 or index($ua, 'playstation portable') != -1 or index($ua, 'netfront') != -1) { } | 
 
|  | 6 | 1593 | elsif (index($ua, 'browsex') != -1) { } | 
 
|  | 18 | 1575 | elsif (index($ua, 'polaris') != -1) { } | 
 
|  | 168 | 1407 | elsif (index($ua, 'mozilla') != -1 and index($ua, 'compatible') == -1) { } | 
 
|  | 12 | 1395 | elsif (index($ua, 'staroffice') != -1) { } | 
 
|  | 6 | 1389 | elsif (index($ua, 'icab') != -1) { } | 
 
|  | 6 | 1383 | elsif (index($ua, 'lotus-notes') != -1) { } | 
 
|  | 24 | 1359 | elsif (index($ua, 'konqueror') != -1) { } | 
 
|  | 6 | 1353 | elsif (index($ua, 'lynx') != -1) { } | 
 
|  | 6 | 1347 | elsif (index($ua, 'elinks') != -1) { } | 
 
|  | 12 | 1335 | elsif (index($ua, 'links') != -1) { } | 
 
|  | 0 | 1335 | elsif (index($ua, 'mosaic') != -1) { } | 
 
|  | 6 | 1329 | elsif (index($ua, 'emacs') != -1) { } | 
 
|  | 30 | 1299 | elsif (index($ua, 'obigo') != -1) { } | 
 
|  | 54 | 1245 | elsif (index($ua, 'teleca') != -1) { } | 
 
|  | 36 | 1209 | elsif (index($ua, 'libcurl') != -1 or $ua =~ /^curl/) { } | 
 
|  | 6 | 1203 | elsif (index($ua, 'puf/') != -1) { } | 
 
|  | 6 | 1197 | elsif (index($ua, 'applecoremedia/') != -1) { } | 
 
|  | 6 | 1191 | elsif (index($ua, 'androiddownloadmanager') != -1) { } | 
 
|  | 12 | 1179 | elsif (index($ua, 'dalvik') != -1) { } | 
 
|  | 6 | 1173 | elsif (index($ua, 'apple-pubsub') != -1) { } | 
 
|  | 6 | 1167 | elsif (index($ua, 'imagesearcherpro') != -1) { } | 
 
| 718 | 6 | 630 | $1 eq 'fxios' ? : | 
 
| 756 | 42 | 1688 | if (index($ua, "aol") != -1 or index($ua, "america online browser") != -1) | 
 
| 822 | 12 | 1332 | if (index($ua, "chromium") != -1) | 
 
| 840 | 276 | 684 | if (index($ua, " mobile safari/") != -1 or index($ua, "mobilesafari") != -1) | 
 
| 845 | 18 | 942 | if (index($ua, "puffin") != -1) | 
 
| 856 | 0 | 0 | if index($ua, "2.") != -1 | 
 
| 895 | 108 | 60 | if (index($ua, 'netscape') != -1 or not $tests->{'gecko'}) { } | 
 
|  | 6 | 54 | elsif (index($ua, 'seamonkey') != -1) { } | 
 
| 981 | 6080 | 1167 | if defined $browser | 
 
| 986 | 462 | 6785 | if index($ua, "x11") != -1 | 
 
| 987 | 1086 | 6161 | if index($ua, ".net clr") != -1 | 
 
| 989 | 18 | 7229 | if (index($ua, "realplayer") != -1) | 
 
| 1006 | 12 | 6 | if ($ua =~ m[realplayer/([\d+\.]+)]) { } | 
 
|  | 6 | 0 | elsif ($ua =~ /realplayer\s(\w+)/) { } | 
 
| 1010 | 12 | 0 | if defined $self->{'minor'} | 
 
| 1017 | 18 | 7229 | if (index($ua, "(r1 ") != -1) | 
 
| 1024 | 480 | 894 | if ($self->android and index($ua, "; wv)") > 0 or $self->chrome and $self->android and $self->browser_major >= 30) | 
 
| 1039 | 78 | 186 | if not ref $m and 0 < index($self->{'user_agent'}, $m) | 
 
| 1040 | 0 | 186 | if "Regexp" eq ref $m and $self->{'user_agent'} =~ /$m/ | 
 
| 1096 | 18 | 8769 | if (index($ua, 'libwww-perl') != -1 or index($ua, 'lwp-') != -1) { } | 
 
|  | 12 | 8757 | elsif (index($ua, 'slurp') != -1) { } | 
 
|  | 6 | 8751 | elsif (index($ua, 'yahoo') != -1 and index($ua, 'jp.co.yahoo') == -1) { } | 
 
|  | 6 | 8745 | elsif (index($ua, 'msnbot-mobile') != -1) { } | 
 
|  | 0 | 8745 | elsif (index($ua, 'bingbot-mobile') != -1) { } | 
 
|  | 6 | 8739 | elsif (index($ua, 'msnbot') != -1) { } | 
 
|  | 30 | 8709 | elsif (index($ua, 'binglocalsearch') != -1 or index($ua, 'bingbot') != -1 or index($ua, 'bingpreview') != -1) { } | 
 
|  | 6 | 8703 | elsif (index($ua, 'microsoft office existence discovery') != -1) { } | 
 
|  | 6 | 8697 | elsif (index($ua, 'ahrefsbot') != -1) { } | 
 
|  | 0 | 8697 | elsif (index($ua, 'altavista') != -1) { } | 
 
|  | 12 | 8685 | elsif (index($ua, 'apache-httpclient') != -1) { } | 
 
|  | 6 | 8679 | elsif ($ua =~ /\( *\) *\{ *\: *\; */) { } | 
 
|  | 0 | 8679 | elsif (index($ua, 'ask jeeves/teoma') != -1) { } | 
 
|  | 18 | 8661 | elsif (index($ua, 'baiduspider') != -1) { } | 
 
|  | 36 | 8625 | elsif (index($ua, 'libcurl') != -1 or $ua =~ /^curl/) { } | 
 
|  | 6 | 8619 | elsif (index($ua, 'facebookexternalhit') != -1) { } | 
 
|  | 6 | 8613 | elsif (index($ua, 'getright') != -1) { } | 
 
|  | 12 | 8601 | elsif (index($ua, 'adsbot-google') != -1) { } | 
 
|  | 6 | 8595 | elsif (index($ua, 'mediapartners-google') != -1) { } | 
 
|  | 6 | 8589 | elsif (index($ua, 'google favicon') != -1) { } | 
 
|  | 6 | 8583 | elsif (index($ua, 'googlebot-image') != -1) { } | 
 
|  | 6 | 8577 | elsif (index($ua, 'googlebot-news') != -1) { } | 
 
|  | 6 | 8571 | elsif (index($ua, 'googlebot-video') != -1) { } | 
 
|  | 18 | 8553 | elsif (index($ua, 'googlebot-mobile') != -1) { } | 
 
|  | 36 | 8517 | elsif (index($ua, 'googlebot') != -1) { } | 
 
|  | 6 | 8511 | elsif ($ua =~ /go.*package http/) { } | 
 
|  | 6 | 8505 | elsif ($ua =~ /^http_request/) { } | 
 
|  | 0 | 8505 | elsif ($ua =~ /^http_request/) { } | 
 
|  | 6 | 8499 | elsif (index($ua, 'indy library') != -1) { } | 
 
|  | 0 | 8499 | elsif (index($ua, 'infoseek') != -1) { } | 
 
|  | 6 | 8493 | elsif (index($ua, 'ips-agent') != -1) { } | 
 
|  | 0 | 8493 | elsif (index($ua, 'lecodechecker') != -1) { } | 
 
|  | 12 | 8481 | elsif (index($ua, 'linkchecker') != -1) { } | 
 
|  | 0 | 8481 | elsif (index($ua, 'lycos') != -1) { } | 
 
|  | 12 | 8469 | elsif (index($ua, 'mechanize') != -1) { } | 
 
|  | 6 | 8463 | elsif (index($ua, 'mj12bot/') != -1) { } | 
 
|  | 18 | 8445 | elsif (index($ua, 'nutch') != -1) { } | 
 
|  | 6 | 8439 | elsif (index($ua, 'puf/') != -1) { } | 
 
|  | 0 | 8439 | elsif (index($ua, 'scooter') != -1) { } | 
 
|  | 6 | 8433 | elsif (index($ua, 'special_archiver') != -1) { } | 
 
|  | 12 | 8421 | elsif (index($ua, 'wget') == 0) { } | 
 
|  | 6 | 8415 | elsif (index($ua, 'yandexbot') != -1) { } | 
 
|  | 6 | 8409 | elsif (index($ua, 'yandeximages') != -1) { } | 
 
|  | 6 | 8403 | elsif (index($ua, 'headlesschrome') != -1) { } | 
 
|  | 42 | 8361 | elsif ($ua =~ /^java/ and not $self->{'browser'}) { } | 
 
|  | 0 | 8361 | elsif (index($ua, 'jdk') != -1) { } | 
 
|  | 6 | 8355 | elsif (index($ua, 'jakarta commons-httpclient') != -1) { } | 
 
|  | 6 | 8349 | elsif (index($ua, 'google-http-java-client') != -1) { } | 
 
|  | 6 | 8343 | elsif (index($ua, 'researchscan.comsys.rwth-aachen.de') != -1) { } | 
 
| 1099 | 18 | 0 | index($ua, 'libwww-perl') != -1 ? : | 
 
| 1305 | 48 | 249450 | if (index($ua, lc $match) != -1) | 
 
| 1314 | 21 | 8759 | if ($browser_tests->{'applecoremedia'} or $browser_tests->{'dalvik'} or $browser_tests->{'adm'}) | 
 
| 1320 | 492 | 8295 | if ($r) { } | 
 
|  | 0 | 8295 | elsif ($ua =~ /seek (?! mo (?: toolbar )? \s+ \d+\.\d+ )/x) { } | 
 
|  | 42 | 8253 | elsif ($ua =~ /search (?! [\w\s]* toolbar \b | bar \b | erpro \b )/x) { } | 
 
|  | 246 | 8007 | elsif ($self->{'user_agent'} =~ m[([\w /\.\-]+)[ \;\(\)]*\+https?\:]i) { } | 
 
| 1324 | 444 | 48 | unless ($id) | 
 
| 1328 | 492 | 0 | unless (exists $robot_tests->{'robot_id'}) | 
 
| 1335 | 270 | 222 | unless defined $robot_fragment | 
 
| 1361 | 7965 | 203113 | if ($ROBOT_FRAGMENT_EXCEPTIONS{$fragment}) | 
 
| 1363 | 0 | 7965 | unless $ROBOT_FRAGMENT_EXCEPTIONS{$fragment} | 
 
| 1364 | 7 | 7958 | if (index($ua, $exception) != -1) | 
 
| 1370 | 311 | 210760 | if (index($ua, $fragment) != -1) | 
 
| 1378 | 599 | 8188 | if (exists $robot_tests->{'robot'} and $robot_tests->{'robot'} eq "unknown") | 
 
| 1383 | 1091 | 7696 | if (defined $robot_fragment) | 
 
| 1388 | 1019 | 72 | if ($self->{'user_agent'} =~ m[\s*                # Beginning whitespace
                                      ([\w .:,\-\@\/]*  # Words before fragment
                                       $robot_fragment  # Match the fragment
                                       [\w .:,\-\@\/]*) # Words after fragment
                                     ]xi) | 
 
| 1397 | 36 | 276 | if ($self->{'user_agent'} eq $full_string and $self->{'user_agent'} =~ m[\/.*\/] and $self->{'user_agent'} =~ m[
                                      ([\w]*               # Words before fragment
                                           $robot_fragment     # Match the fragment
                                           (\/[\d\.]+)?        # Version
                                           [\w]*)              # Beta stuff
                                         ]xi) | 
 
| 1414 | 654 | 365 | if ($full_string and $full_string =~ s[[/ \.v]*(\d+)(\.\d+)?([\.\w]*)$][]) { } | 
 
| 1424 | 353 | 666 | unless (defined $self->{'robot_string'}) | 
 
| 1430 | 6210 | 2577 | if (not exists $self->{'robot_version'}) | 
 
| 1450 | 0 | 7242 | if (index($ua, "16bit") != -1) | 
 
| 1456 | 2964 | 4278 | if (index($ua, "win") != -1) | 
 
| 1457 | 12 | 2952 | if (index($ua, 'win16') != -1 or index($ua, 'windows 3') != -1 or index($ua, 'windows 16-bit') != -1) { } | 
 
|  | 72 | 2880 | elsif (index($ua, 'win95') != -1 or index($ua, 'windows 95') != -1) { } | 
 
|  | 30 | 2850 | elsif (index($ua, 'win 9x 4.90') != -1 or index($ua, 'windows me') != -1) { } | 
 
|  | 24 | 2826 | elsif (index($ua, 'win98') != -1 or index($ua, 'windows 98') != -1) { } | 
 
|  | 12 | 2814 | elsif (index($ua, 'windows 2000') != -1) { } | 
 
|  | 12 | 2802 | elsif (index($ua, 'windows ce') != -1) { } | 
 
|  | 54 | 2748 | elsif (index($ua, 'windows phone') != -1) { } | 
 
| 1463 | 6 | 6 | if (index($ua, 'windows 3.1') != -1) { } | 
 
| 1505 | 6 | 48 | if (index($ua, 'windows phone os 7.0') != -1) { } | 
 
|  | 12 | 36 | elsif (index($ua, 'windows phone os 7.5') != -1) { } | 
 
|  | 12 | 24 | elsif (index($ua, 'windows phone 8.0') != -1) { } | 
 
|  | 18 | 6 | elsif (index($ua, 'windows phone 8.1') != -1) { } | 
 
|  | 6 | 0 | elsif (index($ua, 'windows phone 10.0') != -1) { } | 
 
| 1523 | 3804 | 3438 | if (index($ua, "nt") != -1) | 
 
| 1524 | 90 | 3714 | if (index($ua, 'nt 5.0') != -1 or index($ua, 'nt5') != -1) { } | 
 
|  | 984 | 2730 | elsif (index($ua, 'nt 5.1') != -1) { } | 
 
|  | 126 | 2604 | elsif (index($ua, 'nt 5.2') != -1) { } | 
 
|  | 204 | 2400 | elsif (index($ua, 'nt 6.0') != -1) { } | 
 
|  | 966 | 1434 | elsif (index($ua, 'nt 6.1') != -1) { } | 
 
|  | 96 | 1338 | elsif (index($ua, 'nt 6.2') != -1) { } | 
 
|  | 78 | 1260 | elsif (index($ua, 'nt 6.3') != -1) { } | 
 
|  | 36 | 1224 | elsif (index($ua, 'nt 10.0') != -1) { } | 
 
|  | 54 | 1170 | elsif (index($ua, 'winnt') != -1 or index($ua, 'windows nt') != -1 or index($ua, 'nt4') != -1 or index($ua, 'nt3') != -1) { } | 
 
| 1579 | 2850 | 4392 | if ($os) { } | 
 
|  | 462 | 3930 | elsif (index($ua, 'macintosh') != -1 or index($ua, 'mac_') != -1) { } | 
 
|  | 420 | 3510 | elsif (index($ua, 'ipod') != -1 or index($ua, 'iphone') != -1 or index($ua, 'ipad') != -1) { } | 
 
|  | 1008 | 2502 | elsif (index($ua, 'android') != -1) { } | 
 
|  | 498 | 2004 | elsif (index($ua, 'inux') != -1) { } | 
 
|  | 42 | 1962 | elsif ($tests->{'x11'} and index($ua, 'cros') != -1) { } | 
 
|  | 6 | 1956 | elsif (index($ua, 'amiga') != -1) { } | 
 
|  | 6 | 1950 | elsif (index($ua, 'os/2') != -1) { } | 
 
|  | 6 | 1944 | elsif (index($ua, 'solaris') != -1) { } | 
 
|  | 0 | 1944 | elsif (index($ua, 'samsung') == -1 and index($ua, 'sun') != -1) { } | 
 
|  | 0 | 1944 | elsif (index($ua, 'irix') != -1) { } | 
 
|  | 0 | 1944 | elsif (index($ua, 'hp-ux') != -1) { } | 
 
|  | 0 | 1944 | elsif (index($ua, 'aix') != -1) { } | 
 
|  | 0 | 1944 | elsif ($ua =~ /\bsco\b/ or index($ua, 'unix_sv') != -1) { } | 
 
|  | 0 | 1944 | elsif (index($ua, 'unix_system_v') != -1) { } | 
 
|  | 0 | 1944 | elsif ($ua =~ /\bncr\b/) { } | 
 
|  | 0 | 1944 | elsif (index($ua, 'reliantunix') != -1) { } | 
 
|  | 0 | 1944 | elsif (index($ua, 'dec') != -1 or index($ua, 'osf1') != -1 or index($ua, 'declpha') != -1 or index($ua, 'alphaserver') != -1 or index($ua, 'ultrix') != -1 or index($ua, 'alphastation') != -1) { } | 
 
|  | 0 | 1944 | elsif (index($ua, 'sinix') != -1) { } | 
 
|  | 30 | 1914 | elsif (index($ua, 'bsd') != -1) { } | 
 
|  | 12 | 1902 | elsif ($tests->{'x11'}) { } | 
 
|  | 0 | 1902 | elsif (index($ua, 'vax') != -1 or index($ua, 'openvms') != -1) { } | 
 
|  | 12 | 1890 | elsif (index($ua, 'bb10') != -1) { } | 
 
|  | 6 | 1884 | elsif (index($ua, 'rim tablet os') != -1) { } | 
 
|  | 6 | 1878 | elsif (index($ua, 'playstation 3') != -1) { } | 
 
|  | 6 | 1872 | elsif (index($ua, 'playstation portable') != -1) { } | 
 
|  | 54 | 1818 | elsif (index($ua, 'windows') != -1) { } | 
 
|  | 18 | 1800 | elsif (index($ua, 'win32') != -1) { } | 
 
|  | 144 | 1656 | elsif ($self->{'user_agent'} =~ /(brew)|(\bbmp\b)/i) { } | 
 
| 1583 | 0 | 2850 | if index($ua, "win32") != -1 | 
 
| 1589 | 438 | 24 | if (index($ua, 'mac os x') != -1) { } | 
 
| 1596 | 0 | 462 | if (index($ua, '68k') != -1 or index($ua, '68000') != -1) { } | 
 
|  | 126 | 336 | elsif (index($ua, 'ppc') != -1 or index($ua, 'powerpc') != -1) { } | 
 
| 1646 | 0 | 0 | if index($ua, "i86") != -1 | 
 
| 1647 | 0 | 0 | if index($ua, "sunos 4") != -1 | 
 
| 1648 | 0 | 0 | if index($ua, "sunos 5") != -1 | 
 
| 1654 | 0 | 0 | if index($ua, "irix5") != -1 | 
 
| 1655 | 0 | 0 | if index($ua, "irix6") != -1 | 
 
| 1661 | 0 | 0 | if index($ua, "09.") != -1 | 
 
| 1662 | 0 | 0 | if index($ua, "10.") != -1 | 
 
| 1668 | 0 | 0 | if index($ua, "aix 1") != -1 | 
 
| 1669 | 0 | 0 | if index($ua, "aix 2") != -1 | 
 
| 1670 | 0 | 0 | if index($ua, "aix 3") != -1 | 
 
| 1671 | 0 | 0 | if index($ua, "aix 4") != -1 | 
 
| 1708 | 30 | 0 | if ($self->{'user_agent'} =~ /(\w*bsd\w*)/i) | 
 
| 1712 | 30 | 0 | if index($ua, "freebsd") != -1 | 
 
| 1751 | 102 | 42 | if ($1) { } | 
 
| 1767 | 12 | 6 | if (not $os and $browser_tests->{'firefox'} and index($ua, "fennec") == -1 and $self->mobile || $self->tablet) | 
 
| 1776 | 2550 | 4692 | if ($os and not $os_string) | 
 
| 1791 | 535 | 2039 | if (not defined $os) { } | 
 
|  | 22 | 2017 | elsif ($os eq 'winphone') { } | 
 
|  | 194 | 1823 | elsif ($os eq 'macosx') { } | 
 
|  | 185 | 1638 | elsif ($os eq 'ios') { } | 
 
|  | 20 | 1618 | elsif ($os eq 'chromeos') { } | 
 
|  | 479 | 1139 | elsif ($os eq 'android') { } | 
 
|  | 5 | 1134 | elsif ($os eq 'firefoxos') { } | 
 
|  | 68 | 1066 | elsif ($os eq 'brew') { } | 
 
| 1796 | 22 | 0 | if ($ua =~ /windows phone (?:os )?(\d+)(\.?\d*)([\.\d]*)/) | 
 
| 1801 | 155 | 39 | if ($ua =~ /os x (\d+)[\._](\d+)[\._]?(\d*)/) | 
 
| 1802 | 137 | 18 | length $3 ? : | 
 
| 1806 | 184 | 1 | if ($ua =~ / os (\d+)[\._ ](\d+)[\._ ]?(\d*)/) | 
 
| 1807 | 117 | 67 | length $3 ? : | 
 
| 1811 | 20 | 0 | if ($ua =~ / cros \S* (\d+)(\.?\d*)([\.\d]*)/) | 
 
| 1816 | 464 | 15 | if ($ua =~ /android (\d+)(\.?\d*)([\w\-\.]*)[\;\)]/) | 
 
| 1821 | 5 | 0 | if ($ua =~ m[firefox/(\d+)(\.?\d*)([\.\d]*)]) | 
 
| 1826 | 47 | 21 | if ($ua =~ /(brew|\bbmp) (\d+)(\.?\d*)([\.\d]*)/) | 
 
| 1855 | 264 | 6937 | if (defined $browser and $browser eq 'opera') { } | 
 
|  | 1883 | 5054 | elsif ($ua =~ m[\b compatible; \s* [\w\-]* [/\s] ( [0-9]+ ) (?: .([0-9]+) (\S*) )? ;]x) { } | 
 
|  | 956 | 4098 | elsif (not $browser) { } | 
 
|  | 24 | 4074 | elsif ($browser_tests->{'edge'}) { } | 
 
|  | 940 | 3134 | elsif ($browser_tests->{'safari'}) { } | 
 
|  | 6 | 3128 | elsif ($browser_tests->{'fxios'}) { } | 
 
|  | 78 | 3050 | elsif ($tests->{'meta_app'}) { } | 
 
|  | 12 | 3038 | elsif ($browser_tests->{'instagram'}) { } | 
 
|  | 100 | 2938 | elsif ($browser_tests->{'ie'}) { } | 
 
|  | 6 | 2932 | elsif ($browser eq 'n3ds') { } | 
 
|  | 6 | 2926 | elsif ($browser eq 'browsex') { } | 
 
|  | 6 | 2920 | elsif ($ua =~ m[netscape6/(\d+)\.(\d+)([\d.]*)]) { } | 
 
|  | 12 | 2908 | elsif ($browser eq 'brave') { } | 
 
|  | 18 | 2890 | elsif ($browser eq 'chrome' and $ua =~ m[crios/(\d+)\.(\d+)([\d.]*)]) { } | 
 
|  | 6 | 2884 | elsif ($browser eq 'pubsub' and $ua =~ m[apple-pubsub/(\d+)\.?(\d+)?([\d.]*)]) { } | 
 
|  | 78 | 2806 | elsif ($browser eq 'obigo' and $self->{'user_agent'} =~ m[(obigo[\w\-]*|teleca)[\/ ]\w(\d+)(\w*)]i) { } | 
 
|  | 6 | 2800 | elsif ($browser eq 'polaris' and $ua =~ m[polaris[ \/](\d+)\.?(\d+)?([\d\.]*)]) { } | 
 
|  | 336 | 2464 | elsif ($browser eq 'ucbrowser' and $ua =~ m[ucbrowser[\/ ]*(\d+)\.?(\d+)?([\d\.]*)]) { } | 
 
|  | 6 | 2458 | elsif ($browser eq 'samsung' and $ua =~ m[samsungbrowser/(\d+)\.(\d+)\s]) { } | 
 
|  | 36 | 2422 | elsif ($browser_tests->{'yandex_browser'}) { } | 
 
| 1865 | 90 | 174 | if ($ua =~ m[\AOpera.*\sVersion/(\d*)\.(\d*)\z]i) { } | 
 
|  | 48 | 126 | elsif ($ua =~ m[\bOPR/(\d+)\.(\d+)]i) { } | 
 
|  | 126 | 0 | elsif ($ua =~ m[Opera[ /](\d+).(\d+)]i) { } | 
 
| 1892 | 24 | 0 | unless defined $major | 
 
| 1900 | 875 | 65 | if (do {
	$ua =~ m[ safari/ ( \d+ (?: \.\d+ )* ) ]x
}) { } | 
 
|  | 53 | 12 | elsif ($ua =~ m[applewebkit\/([\d\.]{1,})]xi) { } | 
 
| 1913 | 875 | 0 | if (my($safari_build, $safari_minor) = split(/\./, $1, 3)) | 
 
| 1916 | 809 | 66 | if defined $safari_minor | 
 
| 1920 | 53 | 0 | if (my($safari_build, $safari_minor) = split(/\./, $1, 3)) | 
 
| 1923 | 42 | 11 | if $safari_minor | 
 
| 1936 | 60 | 18 | if ($ua =~ m[ \b fbav/ ([^;]*) ]x) | 
 
| 1938 | 60 | 0 | if ($beta) | 
 
| 1948 | 12 | 0 | if ($self->{'user_agent'} =~ / \b Instagram [ ]+ ([0-9.]+) [ ] /x) | 
 
| 1950 | 12 | 0 | if ($beta) | 
 
| 1959 | 18 | 82 | if ($ua =~ /\b msie \s ( [0-9\.]+ ) (?: [a-z]+ [a-z0-9]* )? ;/x) { } | 
 
|  | 71 | 11 | elsif ($ua =~ /\b rv: ( [0-9\.]+ ) \b/x) { } | 
 
| 1971 | 6 | 0 | if ($ua =~ m[Nintendo 3DS;.*\sVersion/(\d*)\.(\d*)]i) | 
 
| 1977 | 6 | 0 | if ($ua =~ /BrowseX \((\d+)\.(\d+)([\d.]*)/i) | 
 
| 1999 | 12 | 0 | if ($ua =~ m[brave/(\d+)\.(\d+)([\d.]*)]) | 
 
| 2043 | 36 | 0 | if ($self->{'user_agent'} =~ m[ \b YaBrowser / ([0-9.]+) [ ] ]x) | 
 
| 2045 | 36 | 0 | if ($beta) | 
 
| 2053 | 2440 | 4761 | if (not defined $major and defined $self->{'browser_string'}) | 
 
| 2055 | 2243 | 197 | if ($version_index != -1) | 
 
| 2058 | 2232 | 11 | if ($version_str =~ m[/(\d+)\.(\d+)([\w.]*)]) | 
 
| 2067 | 1169 | 6032 | unless (defined $major) | 
 
| 2068 | 24 | 1145 | if ($ua =~ m[version/(\d+)\.(\d+)([\w.]*)]) | 
 
| 2077 | 1145 | 6056 | unless (defined $major) | 
 
| 2094 | 324 | 6877 | unless (defined $major) | 
 
| 2096 | 0 | 324 | if ($ua =~ m[[A-Za-z]+/(\d+)\;]) | 
 
| 2103 | 504 | 6697 | unless $major | 
 
| 2104 | 4688 | 2513 | unless $minor | 
 
| 2105 | 2881 | 4320 | if defined $beta and $beta eq "" | 
 
| 2109 | 168 | 7033 | if ($browser_tests->{'netscape'}) | 
 
| 2112 | 12 | 156 | if $major == 2 | 
 
| 2113 | 18 | 150 | if $major == 3 | 
 
| 2114 | 24 | 144 | if $major == 4 | 
 
| 2115 | 114 | 54 | if $major >= 4 | 
 
| 2116 | 6 | 162 | if $major == 4 and $minor == 5 | 
 
| 2117 | 96 | 72 | if $major == 4 and ".$minor" >= "0.5" or $major >= 5 | 
 
| 2120 | 6 | 162 | if defined $beta and index($beta, "gold") != -1 | 
 
| 2122 | 84 | 84 | if $major == 5 or $major == 6 | 
 
| 2124 | 90 | 78 | if $major >= 5 | 
 
| 2126 | 6 | 162 | if ($browser eq "seamonkey") | 
 
| 2137 | 1708 | 5493 | if ($browser_tests->{'ie'}) | 
 
| 2138 | 23 | 1685 | if $major == 3 | 
 
| 2139 | 35 | 1673 | if $major == 4 | 
 
| 2140 | 1673 | 35 | if $major >= 4 | 
 
| 2141 | 70 | 1638 | if $major == 5 | 
 
| 2142 | 1638 | 70 | if $major >= 5 | 
 
| 2143 | 23 | 1685 | if $major == 5 and $minor == 5 | 
 
| 2144 | 1591 | 117 | if ".$minor" >= "0.5" or $major >= 6 | 
 
| 2145 | 389 | 1319 | if $major == 6 | 
 
| 2146 | 319 | 1389 | if $major == 7 | 
 
| 2147 | 605 | 1103 | if $major == 8 | 
 
| 2148 | 112 | 1596 | if $major == 9 | 
 
| 2149 | 66 | 1642 | if $major == 10 | 
 
| 2150 | 71 | 1637 | if $major == 11 | 
 
| 2159 | 41 | 7160 | if ($browser_tests->{'aol'}) | 
 
| 2162 | 6 | 35 | if index($ua, "aol 3.0") != -1 or $version_tests->{'ie3'} | 
 
| 2165 | 0 | 41 | if index($ua, "aol 4.0") != -1 or $version_tests->{'ie4'} | 
 
| 2166 | 0 | 41 | if index($ua, "aol 5.0") != -1 | 
 
| 2167 | 6 | 35 | if index($ua, "aol 6.0") != -1 | 
 
| 2168 | 0 | 41 | if index($ua, "navio") != -1 | 
 
| 2171 | 264 | 6937 | if ($browser_tests->{'opera'}) | 
 
| 2172 | 6 | 258 | if index($ua, "opera 3") != -1 or index($ua, "opera/3") != -1 | 
 
| 2174 | 0 | 264 | if index($ua, "opera 4") != -1 or index($ua, "opera/4") != -1 and index($ua, "nintendo dsi") == -1 | 
 
| 2178 | 0 | 264 | if index($ua, "opera 5") != -1 or index($ua, "opera/5") != -1 | 
 
| 2181 | 12 | 252 | if index($ua, "opera 6") != -1 or index($ua, "opera/6") != -1 | 
 
| 2184 | 30 | 234 | if index($ua, "opera 7") != -1 or index($ua, "opera/7") != -1 | 
 
| 2209 | 54 | 8257 | if (index($ua, 'windows phone') != -1) { } | 
 
|  | 1014 | 7243 | elsif (index($ua, 'android') != -1 or index($ua, 'silk-accelerated') != -1) { } | 
 
|  | 42 | 7201 | elsif (index($ua, 'blackberry') != -1 or index($ua, 'bb10') != -1 or index($ua, 'rim tablet os') != -1) { } | 
 
|  | 18 | 7183 | elsif (index($ua, 'ipod') != -1) { } | 
 
|  | 162 | 7021 | elsif (index($ua, 'ipad') != -1) { } | 
 
|  | 240 | 6781 | elsif (index($ua, 'iphone') != -1) { } | 
 
|  | 6 | 6775 | elsif (index($ua, 'webos') != -1) { } | 
 
|  | 12 | 6763 | elsif (index($ua, 'kindle') != -1) { } | 
 
|  | 0 | 6763 | elsif (index($ua, 'audrey') != -1) { } | 
 
|  | 0 | 6763 | elsif (index($ua, 'i-opener') != -1) { } | 
 
|  | 0 | 6763 | elsif (index($ua, 'avantgo') != -1) { } | 
 
|  | 0 | 6763 | elsif (index($ua, 'palmos') != -1) { } | 
 
|  | 6 | 6757 | elsif (index($ua, 'playstation 3') != -1) { } | 
 
|  | 6 | 6751 | elsif (index($ua, 'playstation portable') != -1) { } | 
 
|  | 6 | 6745 | elsif (index($ua, 'nintendo dsi') != -1) { } | 
 
|  | 6 | 6739 | elsif (index($ua, 'nintendo 3ds') != -1) { } | 
 
|  | 582 | 6157 | elsif ($browser_tests->{'obigo'} or $browser_tests->{'ucbrowser'} or index($ua, 'up.browser') != -1 or index($ua, 'nokia') != -1 and index($ua, 'windows phone') == -1 or index($ua, 'alcatel') != -1 or $ua =~ /\bbrew\b/ or $ua =~ /\bbmp\b/ or index($ua, 'ericsson') != -1 or index($ua, 'sie-') == 0 or index($ua, 'wmlib') != -1 or index($ua, ' wap') != -1 or index($ua, 'wap ') != -1 or index($ua, 'wap/') != -1 or index($ua, '-wap') != -1 or index($ua, 'wap-') != -1 or index($ua, 'wap') == 0 or index($ua, 'wapper') != -1 or index($ua, 'zetor') != -1) { } | 
 
| 2339 | 7970 | 341 | unless ($device_tests->{'tablet'}) | 
 
| 2393 | 276 | 8035 | if ($browser_tests->{'ucbrowser'} and $self->{'user_agent'} =~ m[ucweb/2.0\s*\(([^\;\)]*\;){3,4}\s*([^\;\)]*?)\s*\)]i) { } | 
 
|  | 12 | 8023 | elsif ($ua =~ m[^(\bmot-[^ /]+)]) { } | 
 
|  | 108 | 7915 | elsif ($browser_tests->{'obigo'} || index($ua, 'brew') != -1 and $self->{'user_agent'} =~ m[\d+x\d+ ([\d\w\- ]+?)( \S+\/\S+)*$]i) { } | 
 
|  | 18 | 7897 | elsif ($ua =~ m[windows phone os [^\)]+ iemobile/[^;]+; ([^;]+; [^;\)]+)]g) { } | 
 
|  | 12 | 7885 | elsif ($ua =~ m[windows phone [^\)]+ iemobile/[^;]+; arm; touch; ([^;]+; [^;\)]+)]g) { } | 
 
|  | 18 | 7867 | elsif ($ua =~ m[windows phone 8[^\)]+ iemobile/[^;]+; ([^;]+; [^;\)]+)]g) { } | 
 
|  | 12 | 7855 | elsif ($ua =~ /bb10; ([^;\)]+)/g) { } | 
 
|  | 6 | 7849 | elsif ($ua =~ /blackberry ([\w.]+)/) { } | 
 
|  | 18 | 7831 | elsif ($ua =~ m[blackberry(\d+)/]) { } | 
 
|  | 12 | 7819 | elsif ($ua =~ /silk-accelerated/) { } | 
 
|  | 942 | 6877 | elsif ($self->{'user_agent'} =~ /android .*\; ([^;]*) build/i) { } | 
 
|  | 114 | 6763 | elsif ($self->{'user_agent'} =~ m[\b((alcatel|huawei|lg|nokia|samsung|sonyericsson)[\w\-]*)/]i) { } | 
 
|  | 6 | 6757 | elsif ($self->{'user_agent'} =~ /CrKey/) { } | 
 
|  | 606 | 6151 | elsif ($device) { } | 
 
| 2449 | 54 | 888 | if ($model =~ /^KF/ or $model =~ /kindle fire/i) { } | 
 
|  | 78 | 810 | elsif ($device_tests->{'tablet'}) { } | 
 
| 2478 | 2160 | 6151 | if ($device) { } | 
 
| 2486 | 2154 | 6157 | if ($device_string) | 
 
| 2495 | 0 | 1726 | unless defined $self->{'user_agent'} | 
 
| 2501 | 0 | 1695 | unless defined $self->{'user_agent'} | 
 
| 2508 | 1891 | 363 | unless exists $self->{'robot_string'} | 
 
| 2515 | 639 | 295 | unless exists $self->{'robot_string'} | 
 
| 2528 | 0 | 0 | $self->robot ? : | 
 
|  | 546 | 0 | $self->{'robot_tests'}{'robot_id'} ? : | 
 
| 2534 | 0 | 415 | unless exists $self->{'robot_string'} | 
 
| 2535 | 415 | 0 | if ($self->{'robot_version'}) { } | 
 
| 2546 | 106 | 0 | if (defined $major) { } | 
 
| 2547 | 105 | 1 | if (defined $minor) { } | 
 
| 2580 | 0 | 4225 | unless defined $self->{'user_agent'} | 
 
| 2581 | 1277 | 2948 | unless $self->{'os_tests'} | 
 
| 2588 | 0 | 4199 | unless defined $self->{'user_agent'} | 
 
| 2589 | 85 | 4114 | unless $self->{'os_tests'} | 
 
| 2595 | 2574 | 1437 | unless exists $self->{'os_version'} | 
 
| 2596 | 1947 | 2064 | if ($self->{'os_version'}) { } | 
 
| 2607 | 476 | 522 | defined $major ? : | 
 
| 2631 | 0 | 0 | unless $self->{'version_tests'} | 
 
| 2643 | 74 | 610 | if ($self->gecko) { } | 
 
| 2653 | 210 | 683 | unless $self->{'version_tests'} | 
 
| 2655 | 893 | 0 | defined $self->{'major'} ? : | 
 
| 2660 | 265 | 909 | unless $self->{'version_tests'} | 
 
| 2668 | 142 | 822 | unless $self->{'version_tests'} | 
 
| 2679 | 883 | 0 | defined $major ? : | 
 
| 2708 | 21 | 1 | defined $major ? : | 
 
| 2736 | 657 | 4749 | if ($self->safari) | 
 
| 2740 | 473 | 184 | if ($ua =~ m[
                version/
                ( \d+ )       # Major version number is everything before first dot
                ( \. \d+ )?   # Minor version number is first dot and following digits
            ]x) | 
 
| 2753 | 152 | 32 | if ($ua =~ m[ safari/ ( \d+ (?: \.\d+ )* ) ]x) | 
 
| 2756 | 111 | 41 | unless ($version) | 
 
| 2765 | 100 | 410 | if $self->_cmp_versions($build, $maybe_build) >= 0 | 
 
| 2770 | 4 | 107 | if $ua =~ m[safari/12x] | 
 
| 2773 | 7 | 141 | unless defined $version | 
 
| 2776 | 2 | 139 | if $minor =~ s/(\D.*)// | 
 
| 2778 | 2 | 139 | $beta ? : | 
 
| 2782 | 1731 | 3050 | unless $self->{'version_tests'} | 
 
| 2793 | 5383 | 5537 | if @a == 0 or $a[0] < $b[0] | 
 
| 2794 | 3754 | 1783 | if @b == 0 or $b[0] < $a[0] | 
 
| 2806 | 196 | 1208 | $self->engine_string eq 'MSIE' ? : | 
 
|  | 180 | 1404 | !$self->engine_string ? : | 
 
| 2814 | 750 | 4921 | if ($self->gecko) | 
 
| 2818 | 1016 | 3905 | if ($self->trident) | 
 
| 2822 | 576 | 3329 | if ($self->ie) | 
 
| 2826 | 31 | 3298 | if ($self->edgelegacy) | 
 
| 2830 | 2727 | 571 | if ($self->webkit) | 
 
| 2834 | 147 | 424 | if ($self->presto) | 
 
| 2838 | 45 | 379 | if ($self->netfront) | 
 
| 2842 | 11 | 368 | if ($self->khtml) | 
 
| 2853 | 1294 | 280 | $self->{'engine_version'} && $self->{'engine_version'} =~ /^(\d+(\.\d+)?)/ ? : | 
 
| 2860 | 1639 | 585 | $self->{'engine_version'} && $self->{'engine_version'} =~ /^(\d+)/ ? : | 
 
| 2867 | 1563 | 549 | $self->{'engine_version'} && $self->{'engine_version'} =~ /^\d+(\.\d+)/ ? : | 
 
| 2874 | 1113 | 311 | $self->{'engine_version'} && $self->{'engine_version'} =~ /^\d+\.\d+([\.\d\+]*)/ ? : | 
 
| 2880 | 140 | 592 | unless $self->{'version_tests'} | 
 
| 2903 | 0 | 4166 | unless exists $self->{'device'} | 
 
| 2910 | 1064 | 773 | unless exists $self->{'device_string'} | 
 
| 2922 | 267 | 1585 | if ($self->safari) | 
 
| 2923 | 8 | 259 | if ($self->major == 1 and $self->{'user_agent'} =~ /\s ( [a-z]{2} ) \)/msx) | 
 
| 2927 | 149 | 110 | if ($self->{'user_agent'} =~ /\s ([a-z]{2})-([A-Za-z]{2})/msx) | 
 
| 2932 | 3 | 1692 | if ($self->aol and $self->{'user_agent'} =~ /;([A-Z]{2})_([A-Z]{2})\)/) | 
 
| 2937 | 12 | 1680 | if ($self->meta_app and $self->{'user_agent'} =~ m[ ;FBLC/ ([a-z]{2}) (?: [_-] ([A-Z]{2}) )? ]x) | 
 
| 2940 | 9 | 3 | $2 ? : | 
 
| 2943 | 4 | 1676 | if ($self->instagram and $self->{'user_agent'} =~ / (?: [(] | ;[ ] ) ([a-z]{2}) [_-] ([A-Z]{2}) [;)] /x) | 
 
| 2946 | 4 | 0 | $2 ? : | 
 
| 2949 | 338 | 1338 | if ($self->{'user_agent'} =~ /\b([a-z]{2})-([A-Za-z]{2})\b/msx) | 
 
| 2953 | 28 | 1310 | if ($self->{'user_agent'} =~ /\[([a-z]{2})\]/msx) | 
 
| 2957 | 1156 | 154 | if ($self->{'user_agent'} =~ /\(([^)]+)\)/msx) | 
 
| 2962 | 144 | 4706 | if ($part =~ /^\s*([a-z]{2})\s*$/ and not $self->webview && $1 eq 'wv') | 
 
| 2980 | 1771 | 0 | if $value | 
 
| 2983 | 1716 | 23 | if $value | 
 
| 2986 | 0 | 1938 | unless $self->{'device_tests'} | 
 
| 2987 | 368 | 1570 | unless $self->{'os_tests'} | 
 
| 2988 | 495 | 1443 | unless $self->{'robot_tests'} | 
 
| 2989 | 231 | 1707 | unless $self->{'version_tests'} | 
 
| 2992 | 1162 | 3196 | if $value | 
 
| 2995 | 3856 | 0 | if $value | 
 
| 2998 | 771 | 0 | if $value | 
 
| 3001 | 1984 | 449 | if $value | 
 
| 3006 | 567 | 1371 | if $self->device | 
 
| 3014 | 1 | 27 | unless $self->{'robot_tests'} | 
 
| 3030 | 0 | 0 | if $self->chrome and $self->browser_major and $self->browser_major >= 41 | 
 
| 3036 | 0 | 0 | if $self->opera and $self->browser_major and $self->browser_major == 40 || $self->browser_major >= 42 |