Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Client Hints Sec-CH-UA-Mobile header to detect mobile #962

Closed
wants to merge 1 commit into from

Conversation

kevinkimball
Copy link
Contributor

Chrome now sends Client Hint headers and a frozen UA string in newer versions. See this post for a full explanation:
https://developer.chrome.com/docs/privacy-security/user-agent-client-hints

Sec-CH-UA-Mobile specifically is a "low-entropy hint" which means it is sent with every request. See:
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-UA-Platform

This partially resolves the issue in #906 although I didn't do anything with tablet detection.

Copy link
Contributor

@digifa digifa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would approve this, even it is a partial fix for identifying mobile devices and does not separate between phones and tablets.
Generic identifying a tablet is more difficult as there are more indicators - next step should be to identify Tablets by known model name in Sec-CH-UA-Model Header.

@serbanghita
Copy link
Owner

serbanghita commented Dec 5, 2024

@kevinkimball pushed your changes manually into production. Thank you! 👏

@digifa thanks for the review, I guess now we have to check every Client Hint specific header
For example Sec-CH-UA-Platform provides the proof if the device is iOS or Android so ultimately if it's mobile

@serbanghita serbanghita closed this Dec 5, 2024
@kevinkimball kevinkimball deleted the sec-ch-headers branch December 7, 2024 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants