-
- 17 Posts
Hi,
I am using ModMobile to detect mobile browsers and switch templates. But when i browse from my windows 8 phone, it is considered as a computer not as a mobile. I want to detect it as a mobile. How could I do that?
Thanks in advance,
Isac Joseph
Isac, please don't post the exact same topic in three locations. I've locked your other posts linking back to this one.
It sounds like modmobile is not updated to include windows phone user agents (
https://github.com/jgulledge19/modMobile/blob/master/core/components/modmobile/model/detectmobile.class.php#L39) but you should be able of adding it to that file.
Based on
http://jonathanstark.com/blog/windows-phone-8-user-agent-string I'd guess you should add "IEMobile" to line 52 of core/components/modmobile/model/detectmobile.class.php:
if ( preg_match('/(up.browser|up.link|mmp|symbian|smartphone|midp|wap|phone|BlackBerry|Android|IEMobile)/i', $user_agent) ) {
Because browsers and devices with their own user agents are added all the time, I'm not a fan of user agent sniffing... if you can responsive development that does not assume specific devices would be better.
-
- 17 Posts
Even then it doesnt detect the windows phones.