browser-detection

Detect Smart TV


Is there any script to detect if the site accessed starting this coming from a Smart TV?

I would like to detect whether a computer, tablet, mobile phone or TV. Anyone know how to do this?


Solution

  • Seeing as most smart TVs use the major browser projects (such as Mozilla, Chromium, Safari etc) as their web browser, you are not going to find much difference in their behavior if at all. Your only good solution is to rely on the courtesy of the browser to provide this information to you via the user-agent property of the header.

    You can consult this list of smart TV user agents to engage at your detection strategy.