Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7121f98

Browse filesBrowse files
committed
Using OS family instead of parsing the UA string
1 parent 5977783 commit 7121f98
Copy full SHA for 7121f98

File tree

Expand file treeCollapse file tree

2 files changed

+10
-2
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+10
-2
lines changed

‎user_agents/devices.json

Copy file name to clipboardExpand all lines: user_agents/devices.json
+9-1Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,14 @@
348348
"is_touch_capable": false,
349349
"ua_string": "Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.6) Gecko/20040503",
350350
"str": "Other / Solaris / Other"
351+
},
352+
"chrome_os": {
353+
"is_bot": false,
354+
"is_mobile": false,
355+
"is_pc": true,
356+
"is_tablet": false,
357+
"is_touch_capable": false,
358+
"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",
359+
"str": "CrOS"
351360
}
352361
}
353-

‎user_agents/parsers.py

Copy file name to clipboardExpand all lines: user_agents/parsers.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ def is_pc(self):
234234
# Maemo has 'Linux' and 'X11' in UA, but it is not for PC
235235
if 'Maemo' in self.ua_string:
236236
return False
237-
if 'CrOS' in self.ua_string:
237+
if 'Chrome OS' in self.os.family:
238238
return True
239239
if 'Linux' in self.ua_string and 'X11' in self.ua_string:
240240
return True

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.