0

I was reading documentation on some bad practices when building a website. The MDN said this is very old and a bad practice but there are certain cases in which it is acceptable. Such as device detection.

https://developer.mozilla.org/en-US/docs/Browser_detection_using_the_user_agent

If I were to build a mobile site and use UAS to detect the device to send a user to a less data intensive website; should I? I know there is fluid and responsive layout but most of those website include rules for a fix desktop width too. Are there any edge cases of devices that do no include mobile in their UAS?

1 Answers1

1

I realise this is an old question but hopefully this isn't too late for you.

I would be very wary of using the UA alone to do anything for the reasons mentioned in the article you linked. That said, there are plenty of situations where you can give a better user experience by using a device detection library like 51 Degrees and being aware of a few things.

In particular you mention less data intensive version of the website. There is something of a trend in places like India, where access to poor quality data connections is the norm, to use browsers like UC browser and Opera mini.

These work by going via a proxy and stripping out a lot of the heavier weight stuff in a web page. Needless to say, this can destroy your lovely ultra-modern, highly responsive interface.

51 Degrees will tell you if the browser is of this type with an attribute called IsDataMinimising and you can adapt accordingly, giving the user a better experience while also saving your bandwidth.

Full disclosure: I work for 51 Degrees.

Steve
  • 1,266
  • 16
  • 37