Skip to content

Commit

Permalink
Merge pull request #38 from glogiotatidis/firefoxos
Browse files Browse the repository at this point in the history
Firefox OS fixes
  • Loading branch information
selwin committed Sep 12, 2015
2 parents bb1f6bc + a10aa4a commit f1d024c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion user_agents/parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
'Windows RT',
'Windows CE',
'Windows Mobile',
'Firefox OS',
)

TOUCH_CAPABLE_DEVICE_FAMILIES = (
Expand Down Expand Up @@ -164,6 +165,8 @@ def is_tablet(self):
return True
if self.os.family.startswith('Windows RT'):
return True
if self.os.family == 'Firefox OS' and 'Mobile' not in self.browser.family:
return True
return False

@property
Expand All @@ -175,7 +178,8 @@ def is_mobile(self):
return True
# Device is considered Mobile OS is Android and not tablet
# This is not fool proof but would have to suffice for now
if self.os.family == 'Android' and not self.is_tablet:
if ((self.os.family == 'Android' or self.os.family == 'Firefox OS')
and not self.is_tablet):
return True
if self.os.family == 'BlackBerry OS' and self.device.family != 'Blackberry Playbook':
return True
Expand Down

1 comment on commit f1d024c

@jdalton
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@selwin OT but I noticed you manage the package for ua-parser.
It's been bumped bumped to consume uap-core 0.5.0.

Please sign in to comment.