How to detect client device type (computer or mobile)? #3301
Replies: 3 comments
-
get user-agent,and try to split it. app.on_connect(lambda :print( [i[1] for i in ui.context.client.environ['asgi.scope']['headers'] if i[0]==b'user-agent'])) |
Beta Was this translation helpful? Give feedback.
0 replies
-
With 1.4.28 we introduced the app.on_connect(lambda: print(ui.context.client.request.headers['user-agent'])) |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thanks @python-and-fiction @rodja, |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Question
Hi everyone,
I'm working on a project and need to find a way for my program to monitor the type of device the client is using, such as whether it's a computer or a mobile device. Does anyone have any suggestions or methods to achieve this?
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions