Skip to content

Commit ec2a0d3

Browse files
committed
Properly identify Google's mobile spider as mobile device.
1 parent 89ca040 commit ec2a0d3

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

‎user_agents/devices.json‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,15 @@
259259
"ua_string": "Mozilla/5.0 (iPhone; U; CPU iPhone OS) (compatible; Googlebot-Mobile/2.1; http://www.google.com/bot.html)",
260260
"str": "Spider / Other / Mobile Safari"
261261
},
262+
"googlebot_mobile_2": {
263+
"is_bot": true,
264+
"is_mobile": true,
265+
"is_pc": false,
266+
"is_tablet": false,
267+
"is_touch_capable": true,
268+
"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)",
269+
"str": "Spider / Other / Mobile Safari"
270+
},
262271
"windows_ce": {
263272
"is_bot": false,
264273
"is_mobile": true,

‎user_agents/parsers.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,9 @@ def is_mobile(self):
177177
# TODO: remove after https://github.com/tobie/ua-parser/issues/126 is closed
178178
if 'J2ME' in self.ua_string or 'MIDP' in self.ua_string:
179179
return True
180+
# This is here mainly to detect Google's Mobile Spider
181+
if 'iPhone;' in self.ua_string:
182+
return True
180183
# Mobile Spiders should be identified as mobile
181184
if self.device.family == 'Spider' and 'Mobile' in self.browser.family:
182185
return True

0 commit comments

Comments
 (0)