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

Change Chrome Android smartphone detection to allow "Mobile" anywhere. #7556

Merged
merged 3 commits into from
Feb 6, 2024

Conversation

JBYoshi
Copy link
Contributor

@JBYoshi JBYoshi commented Jan 20, 2024

Description:

On DuckDuckGo, the "DuckDuckGo/" token is inserted between "Mobile" and "Safari", which breaks the current smartphone/tablet detection. A similar situation occurs in other browsers like Avast and Puffin. This PR changes the mobile detection to accept the "Mobile" token anywhere in the user agent to account for these cases.

See the DuckDuckGo user agent code for some of the expected patterns.

Review

On DuckDuckGo, the "DuckDuckGo/" token is inserted between "Mobile" and "Safari", which breaks the current smartphone/tablet detection. A similar situation occurs in other browsers like Avast and Puffin. This commit changes the mobile detection to accept the "Mobile" token anywhere in the user agent to account for these cases.

See https://github.com/duckduckgo/Android/blob/fc6bf1db40adc92d6b15e7f333c3f5ece47569cd/user-agent/user-agent-impl/src/test/java/com/duckduckgo/user/agent/impl/UserAgentProviderTest.kt#L551-L615.
@JBYoshi
Copy link
Contributor Author

JBYoshi commented Feb 5, 2024

Could someone look at this?

@sanchezzzhak
Copy link
Collaborator

Yes, everything is fine, the main thing is that we do not meet a brand with mobile prefixes in the future

@sanchezzzhak sanchezzzhak merged commit 1ed6514 into matomo-org:master Feb 6, 2024
15 checks passed
@JBYoshi JBYoshi deleted the moved-mobile-token branch February 13, 2024 01:12
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.

2 participants