File tree 1 file changed +9
-1
lines changed
1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -106,9 +106,12 @@ def get_browser_name(user_agent_string):
106
106
'''
107
107
ua_dict = user_agent_parser .Parse (user_agent_string )
108
108
name = ua_dict .get ('user_agent' ).get ('family' ).lower ()
109
+ device = ua_dict .get ('device' ).get ('model' )
109
110
if (name == 'firefox mobile' and
110
111
ua_dict .get ('os' ).get ('family' ) == 'Firefox OS' ):
111
112
name = 'other'
113
+ if device == 'Tablet' :
114
+ name += " " + device .lower ()
112
115
return name
113
116
114
117
@@ -128,7 +131,12 @@ def get_browser(user_agent_string):
128
131
version = version + "." + ua .get ('patch' )
129
132
else :
130
133
version = ''
131
- return '{0} {1}' .format (name , version )
134
+ # Check for tablet devices
135
+ if ua_dict .get ('device' ).get ('model' ) == 'Tablet' :
136
+ model = '(Tablet)'
137
+ else :
138
+ model = ''
139
+ return '{0} {1} {2}' .format (name , version , model )
132
140
133
141
134
142
def get_os (user_agent_string ):
You can’t perform that action at this time.
0 commit comments