-
Notifications
You must be signed in to change notification settings - Fork 171
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
Over time, more desktops are detecting as "mobile"... #70
Comments
I haven't had any similar reports so far. However I cannot double check as I don't use this app in production anymore. Let's keep this issue open if someone else stumbles upon it and can report helpful information. |
I'm having this problem as well. In fact, it seems to alternate between mobile / desktop when I shift-reload pages. |
0.7.0 is showing the Desktop version for me with Django 1.9.6 regardless of caching on an iphone 6. @undernewmanagement that sounds like a caching issue. The desktop is possibly caching and being served to the mobile. I would check your caching settings. |
I would be willing to exchange the mobile detection with new logic. However I haven't looked into this topic for quite a while. It would be awesome if someone with more experience in this field could step up and provide some suggestions on how we could do the mobile detection in a more reliable way than currently. |
@gregmuellegger I think you forget to convert USER_AGENT to lowercase, it seems just convert it to lowercase will work well. # Test common mobile values.
if self.user_agents_test_search_regex.search(user_agent.lower()) and \
not self.user_agents_exception_search_regex.search(user_agent.lower()):
is_mobile = True |
@gregmuellegger -- I have a fork on my machine where I plan to rip out the current detection method and replace it with the python port of mobiledetect (https://github.com/serbanghita/Mobile-Detect). This is that port: https://bitbucket.org/trbs/pymobiledetect/overview However, I think I will try @phodal 's solution before taking such drastic measures. |
We've used this package on a site (American Experience) and while it's done a great job for several years, we're getting complaints from some users that their browser is being detected as mobile when it's not. The frequency of these complaints is increasing with time. I've checked the lists in MobileDetectionMiddleware (middeware.py) and it doesn't appear to have changed...
Of course user complaints aren't providing information like "Oh and BTW, my user agent is [this] in case it helps" :-) so tracking down the offending user agent string(s) has not been successful.
Has anyone else experienced this effect? Has anyone made adjustments to the regex lists that improve accuracy? I'd appreciate any wisdom/suggestions...
The text was updated successfully, but these errors were encountered: