donatj / PhpUserAgent

Lightning Fast, Minimalist PHP User Agent String Parser.
https://donatstudios.com/PHP-Parser-HTTP_USER_AGENT
MIT License
559 stars 129 forks source link

Consider supporting smart TV UA strings. #70

Open akosphp opened 3 years ago

akosphp commented 3 years ago

Would you consider detecting popular smart TV operating systems? (like LG WebOS). What about detecting Apple TV, Google Chromecast and others? I know that most of them are running Linux, but it would be nice to get more specific results.

Samrt TV UA strings: https://deviceatlas.com/blog/list-smart-tv-user-agent-strings List of LG WebOS user agent strings: http://webostv.developer.lge.com/discover/specifications/web-engine/

donatj commented 3 years ago

It's been in consideration for a while.

The biggest hesitation thus far is that they're not very locked down, and vary a lot not just between manufacturers but from device to device. This makes them a lot to detect and a lot to support.


I was curious what kind of usage there was for these devices, so while not totally scientific, I parsed through 850 million access log rows from a number of sites I manage.

Apple TV

none

Unsurprising as the browser is only embedded within Apps for authorization and such and not a general purpose browser.

Google Chromecast

none

I don't imagine many people cast their browser to their TV, and I doubt this will remain sniffable in the future anyway with Chrome locking down their user agents.

Amazon Fire Stick

Records UA String
18 Mozilla/5.0 (Linux; Android 5.1.1; AFTT) AppleWebKit/537.36 (KHTML, like Gecko) Silk/86.1.106 like Chrome/86.0.4240.110 Safari/537.36
9 Mozilla/5.0 (Linux; Android 7.1.2; AFTMM Build/NS6265; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/70.0.3538.110 Mobile Safari/537.36

Roku

none

Samsung Smart TV

Records UA String
33 Mozilla/5.0 (SMART-TV; Linux; Tizen 2.3) AppleWebkit/538.1 (KHTML, like Gecko) SamsungBrowser/1.0 TV Safari/538.1
155 Mozilla/5.0 (SMART-TV; Linux; Tizen 4.0) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/2.1 Chrome/56.0.2924.0 TV Safari/537.36
33 Mozilla/5.0 (SMART-TV; Linux; Tizen 5.0) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/2.2 Chrome/63.0.3239.84 TV Safari/537.36
4 Mozilla/5.0 (Linux; NetCast; U) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.33 Safari/537.31 SmartTV/5.0
3 Mozilla/5.0 (Linux; NetCast; U) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/38.0.2125.122 Safari/537.31 SmartTV/7.5
68 Mozilla/5.0 (Linux; NetCast; U) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/53.0.2785.34 Safari/537.31 SmartTV/6.0
92 Mozilla/5.0 (Linux; NetCast; U) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/53.0.2785.34 Safari/537.31 SmartTV/8.5
17 Mozilla/5.0 (Linux; NetCast; U) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.79 Safari/537.4 SmartTV/4.6
16 Mozilla/5.0 (Linux; U) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/53.0.2785.34 Mobile Safari/537.36 (SmartTV/8.5) (NetCast) (Android)
61 Mozilla/5.0 (Linux; U) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Mobile Safari/537.36 SmartTV/7.0 (NetCast) Android

Sony Bravia

Records UA String
35 35 Mozilla/5.0 (Linux; Andr0id 8.0.0; BRAVIA 4K GB Build/OPR2.170623.027.S34) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36 OPR/46.0.2207.0 OMI/4.11.2.40.DIA4.93 Model/Sony-BRAVIA-4K-GB

Toshiba Smart TV

none

Philips Smart TV

none

However I have two records for other non Philips HbbTV devices

Records UA String
1 Mozilla/5.0 (;;;) AppleWebKit/534.6 HbbTV/1.1.1 (+DL+PVR; inverto; IDL 6654N Volksbox Web Edition +; 1.0; 1.0;) hdplusinteraktiv/1.0 (NETRANGEMMH;) CE-HTML/1.0
1 Mozilla/5.0 (;;;) AppleWebKit/534.6 HbbTV/1.1.1 (+DL+PVR; telestar; DIGIO; 1.0; 1.0;) hdplusinteraktiv/1.0 (NETRANGEMMH;) CE-HTML/1.0

LG WebOS

Very surprising to me none.

I actually have own a Smart LG TV but I never use the smart features. I don't even know if it comes with a browser. I'll have to poke that some later tonight.


Based on this, none of them individually reach 1% saturation, let alone as a whole. 1% is my usual "is this worth supporting" line.

I'll leave this ticket open though and pin it for future consideration.