Skip to content

Commit

Permalink
add support to googlebot-mobile user agent that wasn't handled before.
Browse files Browse the repository at this point in the history
  • Loading branch information
Felipe Trzaskowski committed Apr 6, 2015
1 parent 38f06e8 commit 72b5f8e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
9 changes: 9 additions & 0 deletions user_agents/devices.json
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,15 @@
"ua_string": "Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5376e Safari/8536.25 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)",
"str": "Spider / Other / Mobile Safari"
},
"googlebot_mobile_3": {
"is_bot": true,
"is_mobile": true,
"is_pc": false,
"is_tablet": false,
"is_touch_capable": false,
"ua_string": "DoCoMo/2.0 N905i(c100;TB;W24H16) (compatible; Googlebot-Mobile/2.1; +http://www.google.com/bot.html)",
"str": "Spider / Other / Other"
},
"windows_ce": {
"is_bot": false,
"is_mobile": true,
Expand Down
2 changes: 2 additions & 0 deletions user_agents/parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@ def is_mobile(self):
# This is here mainly to detect Google's Mobile Spider
if 'iPhone;' in self.ua_string:
return True
if 'Googlebot-Mobile' in self.ua_string:
return True
# Mobile Spiders should be identified as mobile
if self.device.family == 'Spider' and 'Mobile' in self.browser.family:
return True
Expand Down

0 comments on commit 72b5f8e

Please sign in to comment.