File tree Expand file tree Collapse file tree 2 files changed +5
-0
lines changed
Filter options
Expand file tree Collapse file tree 2 files changed +5
-0
lines changed
Original file line number Diff line number Diff line change @@ -231,6 +231,8 @@ def is_pc(self):
231
231
# Maemo has 'Linux' and 'X11' in UA, but it is not for PC
232
232
if 'Maemo' in self .ua_string :
233
233
return False
234
+ if 'CrOS' in self .ua_string :
235
+ return True
234
236
if 'Linux' in self .ua_string and 'X11' in self .ua_string :
235
237
return True
236
238
return False
Original file line number Diff line number Diff line change 30
30
android_firefox_aurora_ua_string = 'Mozilla/5.0 (Android; Mobile; rv:27.0) Gecko/27.0 Firefox/27.0'
31
31
thunderbird_ua_string = 'Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 Lightning/4.0.2'
32
32
outlook_usa_string = 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/6.0; Microsoft Outlook 15.0.4420)'
33
+ chromebook_ua_string = 'Mozilla/5.0 (X11; CrOS i686 0.12.433) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.77 Safari/534.30'
33
34
34
35
iphone_ua = parse (iphone_ua_string )
35
36
ipad_ua = parse (ipad_ua_string )
54
55
android_firefox_aurora_ua = parse (android_firefox_aurora_ua_string )
55
56
thunderbird_ua = parse (thunderbird_ua_string )
56
57
outlook_ua = parse (outlook_usa_string )
58
+ chromebook_ua = parse (chromebook_ua_string )
57
59
58
60
59
61
class UserAgentsTest (unittest .TestCase ):
@@ -165,6 +167,7 @@ def test_is_pc(self):
165
167
self .assertTrue (ie_touch_ua .is_pc )
166
168
self .assertTrue (ie_ua .is_pc )
167
169
self .assertFalse (android_firefox_aurora_ua .is_pc )
170
+ self .assertTrue (chromebook_ua .is_pc )
168
171
169
172
def test_is_bot (self ):
170
173
self .assertTrue (google_bot_ua .is_bot )
You can’t perform that action at this time.
0 commit comments