mirror of https://github.com/zulip/zulip.git
emails: Add detection for ChromeOS User-Agents.
This commit is contained in:
parent
75376a3fc5
commit
f4c82a1153
|
@ -53,6 +53,8 @@ def get_device_os(user_agent: str) -> Optional[str]:
|
|||
return "iOS"
|
||||
elif "like mac os x" in user_agent:
|
||||
return "iOS"
|
||||
elif " cros " in user_agent:
|
||||
return "ChromeOS"
|
||||
else:
|
||||
return None
|
||||
|
||||
|
|
|
@ -153,6 +153,9 @@ class TestBrowserAndOsUserAgentStrings(ZulipTestCase):
|
|||
'<WebKit Rev> (KHTML, like Gecko) Chrome/<Chrome Rev> Safari'
|
||||
'/<WebKit Rev> Edge/<EdgeHTML Rev>.'
|
||||
'<Windows Build>', 'Edge', 'Windows'),
|
||||
('Mozilla/5.0 (X11; CrOS x86_64 10895.56.0) AppleWebKit/537.36'
|
||||
'(KHTML, like Gecko) Chrome/69.0.3497.95 Safari/537.36',
|
||||
'Chrome', 'ChromeOS'),
|
||||
('', None, None),
|
||||
]
|
||||
|
||||
|
|
Loading…
Reference in New Issue