Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding missing browsers being detected and various code fixes #254

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
566 changes: 283 additions & 283 deletions data/applications-bots.php

Large diffs are not rendered by default.

568 changes: 344 additions & 224 deletions data/applications-browsers.php

Large diffs are not rendered by default.

197 changes: 101 additions & 96 deletions data/applications-others.php

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion data/regexes/applications-bots.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

namespace WhichBrowser\Data;

Applications::$BOTS_REGEX = '/(008|360|a6|abound|muncher|adaxas|addthis|admantx|ahrefsbot|archiver|altavista|curious|cloudfront|amorank|archive|jeeves|astra|backlink|baidu|bazqux|bingbot|msnbot|msmobot|bing|blogbridge|bloglines|bloglovin|blogpulse|blogram|blogtrot|blogshares|boardreader|browsershots|bubing|butterfly|heritrix|cliqz|cloudflare|comodo|commafeed|cbot|watchdog|datasearch|daumoa|digg|domain|exabot|exactseek|ezooms|facebook|fast|flamingo|fastladder|feed|wrangler|validator|fever|friendica|robot|genieo|fetchor|google|gomez|ichiro|gooblog|goorss|grammarly|grub|hatena|capture|heureka|htdig|httpmon|hubpages|spider|crawler|kouio|larbin|linkedin|linkdex|livedoor|ltx71|magpie|mapion|socialstreams|mixi|mnogo|monitor|yeti|netcraft|netvibes|newsblur|newsgator|orange|pages|psbot|pingdom|pinterest|postrank|python|comment|rssbar|hunter|quora|safesearch|scrapy|seznam|shopwiki|reader|simplepie|site24|sogou|sophora|soso|spdycheck|spinn|detector|summify|telegram|twisted|twitter|tiny|tlsprober|typhoeus|vagabondo|voila|vocus|mcrawler|w3bot|jigsaw|w3c|wayback|webindexer|wordpress|mechanize|xerka|sitemap|yacy|yandex|yahoo|y\!j|slurp|httpclient|nutch|synapse|indy|wget|curl|package|java|simple|libwww|lwp|urllib|php|pear|zend|ruby)/i';
Applications::$BOTS_REGEX = '/(008|360|a6|abound|muncher|adaxas|addthis|admantx|ahrefsbot|archiver|altavista|curious|cloudfront|amorank|archive|jeeves|astra|backlink|baidu|bazqux|bingbot|msnbot|msmobot|bing|blogbridge|bloglines|bloglovin|blogpulse|blogram|blogtrot|blogshares|boardreader|browsershots|bubing|butterfly|heritrix|cliqz|cloudflare|comodo|commafeed|cbot|watchdog|datasearch|daumoa|digg|domain|exabot|exactseek|ezooms|facebook|fast|flamingo|fastladder|feed|wrangler|validator|fever|friendica|robot|genieo|fetchor|google|gomez|ichiro|gooblog|goorss|grammarly|grub|hatena|capture|heureka|htdig|httpmon|hubpages|spider|crawler|kouio|larbin|linkedin|linkdex|livedoor|ltx71|magpie|mapion|socialstreams|mixi|mnogo|monitor|yeti|netcraft|netvibes|newsblur|newsgator|orange|pages|psbot|pingdom|pinterest|postrank|python|comment|rssbar|hunter|quora|safesearch|scrapy|seznam|shopwiki|reader|simplepie|site24|sogou|sophora|soso|spdycheck|spinn|detector|summify|telegram|twisted|twitter|tiny|tlsprober|typhoeus|vagabondo|voila|vocus|mcrawler|w3bot|jigsaw|w3c|wayback|webindexer|wordpress|mechanize|xerka|sitemap|yacy|yandex|yahoo|y\!j|slurp|httpclient|nutch|synapse|indy|wget|curl|package|java|simple|libwww|lwp|urllib|php|pear|zend|ruby)/u';
2 changes: 1 addition & 1 deletion data/regexes/applications-browsers.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

namespace WhichBrowser\Data;

Applications::$BROWSERS_REGEX = '/(115|126|2345|qihu|7star|abrowse|acorn|acoo|aol|america|arachne|arora|aweb|avant|asw|aviator|flyflow|bdbrowser|bdspark|beamrise|blackwren|brave|byffox|camino|canure|charon|chromeplus|cometbird|comodo|dragon|conkeror|coolnovo|cunaguaro|cyberfox|daedalus|dillo|rhodonit|eudoraweb|flock|galeon|epiphany|ibrowse|icab|iceape|icecat|iceweasel|iridium|iron|kazehakase|kchrome|meleon|lbbrowser|lobo|lunascape|naenara|mxbrowser|mixshark|mlbrowser|netpositive|origyn|owb|orca|oregano|otter|palemoon|qtweb|qupzilla|rekonq|ryouko|saayaa|sleipnir|metasr|stainless|sunchrome|superbird|swing|tencent|tenfourfox|theworld|tungsten|vivaldi|voyager|waterfox|yabrowser|1password|3g explorer|4g explorer|atomiclite|au|awakening|baidu|bdmobile|bidu|baiduboxapp|browser|blazer|acheetahi|cornowser|coolmarket|cute|digia|doris|doroty|www browser|eui|go\.web|helium|huohoubrowser|surfboard|isurf|jig browser|jumanji|kiosk|lebrowser|liebao|macross|mammoth|mcent|mib|cmcs|motorola|netfrontlife|onebrowser|plink|polaris|openwave|up|km|oppo|quark|semc|stnc|sogou|symphony|ucpro|vivo|weblite|alti|aplix|awox|browserserver|isis|spyglass|oregan|viera|zetakey|bunjalloo|nwf|nuanti|wib|prince|demobrowser|dooble|dwb|evm|fireweb|hive|intermec|phantom|qt|roccat|raven|rockmelt|scope|slim|smbrowser|snowshoe|sputnik|surf|tao|taz|uzbl|villanova|vimb|wada|wavelink|webrender|webster|wyzo|yelang|yrcweb|linemode|lynx|links|w3m|nimbus|Webwasher|sankore|adapi|brightsign|coship)/i';
Applications::$BROWSERS_REGEX = '/(115|126|2345|37abc|qihu|qiyu|1stbrowser|7star|abrowse|acorn|acoo|adventurer|alienforce|amigo|aol|america|aolshield|apus|arachne|arcfox|arora|aweb|avant|asw|aventsec|aviator|avira|flyflow|bdbrowser|bdspark|basilisk|beamrise|blackwren|blackhawk|bolt|brave|brisk|browsex|browzar|byffox|camino|canure|ccleaner|cent|charon|chedot|cheshire|chimera|chimlac|chromeplus|classilla|cometbird|comodo|dragon|conkeror|coocoo|colibri|coolnovo|crazy|cunaguaro|cyberfox|daedalus|degan|deepexpl|dillo|rhodonit|element|elements|eudoraweb|falkon|flamesky|flock|framafox|freeu|galeon|epiphany|headless|hola|hv3|ibrowse|icab|icebrow|iceape|icecat|icedove|iceweasel|iridium|iron|juzi|kapiko|kazehakase|kchrome|kinza|kirix|meleon|kninja|kkman|klondike|kylo|lbbrowser|lieyang|light|lobo|lolifox|lovense|luakit|lunascape|naenara|mxbrowser|min|mini|mixshark|mlbrowser|multizilla|mypal|nichrome|netpositive|netcast|ntent|origyn|owb|orca|oregano|otter|palemoon|pirate|privacy|qtweb|quicklook|qute|qupzilla|rekonq|ryouko|saayaa|salam|seznam|shiira|sleipnir|slimerjs|slimjet|sielo|sitekiosk|metasr|sputnik|irondesktop|stainless|station|sunchrome|sunrise|superbird|swing|surf|tencent|tenfourfox|theworld|tungsten|ur|vivaldi|vmware|voyager|waterfox|webexplorer|whale|winwap|yabrowser|zvu|1password|3g explorer|4g explorer|aloha|atomiclite|au|awakening|baidu|bdmobile|bidu|baiduboxapp|browser|blazer|acheetahi|cornowser|coolmarket|cute|corom|digia|diigo|doris|doroty|ecosia|epic|www browser|eui|fluid|go\.web|helium|heytap|huohoubrowser|surfboard|isurf|jig browser|jumanji|kbrowser|kiosk|kiwi|lebrowser|liebao|macross|mammoth|mcent|mint|mobicip|mib|cmcs|motorola|netfrontlife|onebrowser|oneplus|plink|polaris|openwave|up|km|oppo|quark|semc|stnc|startbrowser|sogou|ironmobile|symphony|tenta|ucpro|vivo|weblite|wk|yaani|alti|aplix|awox|freebox|browserserver|isis|spyglass|oregan|viera|zetakey|bunjalloo|nwf|nuanti|wib|prince|tesla|demobrowser|dooble|dwb|evm|fireweb|hive|intermec|phantom|qt|roccat|raven|rockmelt|scope|slim|smbrowser|snowshoe|surfchina|tao|taz|uzbl|villanova|vimb|wada|wavelink|webrender|webster|wyzo|yelang|yrcweb|linemode|lynx|links|w3m|nimbus|Webwasher|sankore|adapi|brightsign|coship)/u';
2 changes: 1 addition & 1 deletion data/regexes/applications-others.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

namespace WhichBrowser\Data;

Applications::$OTHERS_REGEX = '/(itunes|qt|bluefish|nightingale|songbird|stagefright|substream|vlc|windows-media|coreplayer|flycast|boxee|kodi|xbmc|lightning|thunderbird|outlook|lotus|postbox|bat|yahoo|daum|flipboard|akregator|blogos|cococ|feed|liferea|news|jetbrains|rss|reeder|reedkit|rome|ziepod|messenger|kik|wire|yammer|fbios|fb4a|googleplus|instagram|pinterest|weibo|tumblr|twitter|wp-android|office|bingweb|hao123|gsa|naver|sogousearch|yandex|atom|golive|brackets|iweb|frontpage|amaya|websphere|download|tansodl|origin|secondlife|valve|raptr|alipay|cooliris|google|leechcraft|expeditor)/i';
Applications::$OTHERS_REGEX = '/(itunes|qt|bluefish|nightingale|songbird|stagefright|substream|vlc|windows-media|coreplayer|flycast|boxee|kodi|xbmc|lightning|thunderbird|outlook|lotus|postbox|bat|yahoo|daum|flipboard|akregator|blogos|cococ|feed|liferea|news|jetbrains|rss|reeder|reedkit|rome|ziepod|messenger|kik|rocketchat|slack|wire|yammer|fbios|fb4a|fbsv|fbav|googleplus|instagram|pinterest|weibo|tumblr|twitter|wp-android|office|bingweb|hao123|gsa|naver|sogousearch|yandex|atom|golive|brackets|iweb|frontpage|amaya|websphere|download|tansodl|origin|secondlife|valve|raptr|alipay|cooliris|google|leechcraft|expeditor)/u';
10 changes: 6 additions & 4 deletions src/Analyser/Header/Useragent/Browser.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ private function &refineBrowser($ua)
}




/* Safari */

private function detectSafari($ua)
Expand Down Expand Up @@ -673,7 +671,7 @@ private function detectOpera($ua)

private function detectFirefox($ua)
{
if (!preg_match('/(Firefox|GranParadiso|Namoroka|Shiretoko|Minefield|BonEcho|Fennec|Phoenix|Firebird|Minimo|FxiOS|Focus)/ui', $ua)) {
if (!preg_match('/(Firefox|Lorentz|GranParadiso|Namoroka|Shiretoko|Minefield|BonEcho|Fennec|Phoenix|Firebird|Minimo|FxiOS|Focus)/ui', $ua)) {
return;
}

Expand Down Expand Up @@ -738,7 +736,7 @@ private function detectFirefox($ua)
}


if (preg_match('/(GranParadiso|Namoroka|Shiretoko|Minefield|BonEcho)/u', $ua, $match)) {
if (preg_match('/(Lorentz|GranParadiso|Namoroka|Shiretoko|Minefield|BonEcho)/u', $ua, $match)) {
$this->data->browser->stock = false;
$this->data->browser->name = 'Firefox';
$this->data->browser->channel = str_replace('GranParadiso', 'Gran Paradiso', $match[1]);
Expand Down Expand Up @@ -1597,6 +1595,10 @@ private function detectWebOSBrowser($ua)
$this->data->browser->name = 'webOS Browser';
$this->data->browser->type = Constants\BrowserType::BROWSER;

if (preg_match('/wOSBrowser\/([0-9.]*)/u', $ua, $match)) {
$this->data->browser->version = new Version([ 'value' => $match[1] ]);
}

if ($this->data->os->name != 'webOS') {
$this->data->os->name = 'webOS';
}
Expand Down
8 changes: 8 additions & 0 deletions tests/data/car/tesla.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,11 @@
headers: 'User-Agent: Mozilla/5.0 (X11; U; Linux; C) AppleWebKit/533.3 (KHTML, like Gecko) QtCarBrowser Safari/533.3'
result: { engine: { name: Webkit, version: '533.3' }, device: { type: car, manufacturer: Tesla, model: 'Model S' } }
readable: 'a Tesla Model S'
-
headers: 'User-Agent: Mozilla/5.0 (X11; U; Linux; C) AppleWebKit/533.3 (KHTML, like Gecko) QtCarBrowser Safari/533.3'
result: { browser: { name: 'Tesla Browser', type: browser }, engine: { name: Webkit, version: '533.3' }, device: { type: car, manufacturer: Tesla, model: 'Model S' } }
readable: 'Tesla Browser on a Tesla Model S'
-
headers: 'User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2110.0 TeslaBrowser/1.0.0.4863 Safari/537.36'
result: { browser: { name: 'Tesla Browser', family: { name: Chrome, version: 38.0.2110.0 }, version: 1.0.0.4863, type: browser }, engine: { name: Webkit }, os: { name: Windows, version: { value: '6.1', alias: '7' } }, device: { type: car, manufacturer: Tesla, model: 'Model S' } }
readable: 'Tesla Browser on a Tesla Model S'
Loading