Programmatically detect a mobile website?

Nick1

Junior Member
Joined
Oct 16, 2009
Messages
196
Reaction score
45
I'm trying to go through a fairly big list of websites to check if they have a mobile version.

Are there any elements I should watch out for in particular that are not present in "normal" websites?

Thanks BHW
 
There are many different ways to achieve a mobile version, such as:
- Responsive design (essentially achieved with media queries in CSS)
- Redirection (when you try to access the website from a mobile, you're redirected to http:/ /m.website.com - for example)
- WP plugins such as WPTouch that replace your current theme when accessed from a mobile
- and probably many more

That is to say, I'm not sure there is surefire way to automatically sort through your list and tell which one has a mobile version or not.
Though if someone has a solution, I'd be interested to hear it too.

Otherwise, you'll probably have to browse to each one with your smartphone, or pay someone to do it for you.
 
^^ However you might do it quicker if you use an emulator like http://www.howtogomo.com/en-gb/d/test-your-site/#getmo-meter
It's by google and produces a cool report if selling mobile sites to non mobile clients.
 
I do like thegomo site but I think blue train mobile is a little better and goes more in depth with their review

Other alternatives you can look at are as follows:

There's a qr code plugin you can get for Firefox (I think it's called 2d barcode) am on my iPad right now so can't check till later

- once installed open up the URL you want to check in Firefox
- hover your mouse over the plugin so it generates the qr code
- scan the qr code with your smart phone/itouch
- if they have a mobile site you should be redirected to it

Sometimes mobile sites don't react to mobile emulators as they do on a real device

Also there is user agent switcher for Firefox - problem is with that if the desktop mobile redirection script is using JavaScript screen size detection it won't function if your looking at it on your desktop.

Additionally another flaw in screen size detection is that many of the new android devices show incorrect screen sizes typically larger that 600 px which is what I find many of these scripts set too...

If you can't get your hands on a real mobile handset - check out perfectomobile.com

Hope that helps

Uke
 
Last edited:
As previously mentioned, there are a number of ways by which the mobile version of a website can be shown, which makes it virtually impossible to ascertain whether or not a mobile version exists just by looking at code elements.

Other than using an actual smart-phone, the next best approaches are:

1. Use the Safari Browser with User Agent set to iPhone. This will let detect a mobile version.
2. Download a smart-phone emulator (not a simulator). There are some good, free ones online such as Mobilizer.

Neither method is 100% effective, but certainly close enough to get you what you need.

Hope this helps,
John
 
Back
Top