Before telling me that the question have been asked earlier only with after reading my title, read further.
I would like to know the best way to detect mobile browser without sniffing the headers for the simple reason that this can be modified addons on a desktop's computer.
The reason for this is that I am building a HTML5 Game and I do not want it to be played on a desktop's computer. It will probably end up being played by automated bots if I let this happens.
The only way I can think of is to compare Javascript offsetWidth
of document/window
and compare it against a list of possibles sizes. But, I believe that in a not so long future, phones and tablets will have similar screen resolution then desktop's computer and I couldn't take them apart.
What are my other options? Of course, Javascript is very welcomed.