1

Is it possible to detect the underlaying screen technology of the user's device in JavaScript? How do I differentiate between an LCD, e-ink, and OLED display?

Daniel
  • 4,525
  • 3
  • 38
  • 52
  • It seems that it's [not possible](https://stackoverflow.com/a/15052764/5247200) even with an Android API. – David Oct 11 '18 at 02:58
  • Not too sure if there is a way to directly detecting this, you may have to end up using user agent strings or something. – Steven Tang Oct 11 '18 at 02:58
  • 1
    @StevenTang - and then check the user agent on a database. My guess is that are not better options. – David Oct 11 '18 at 03:02
  • I think even the OS can not support this. Maybe the motherboard can do this – sinbar Oct 11 '18 at 03:02
  • I guess this is possible with a combination of CSS and JavaScript. Though, I have only accomplished it detecting Retina display for Macbooks maybe it can be done with OLED display also. – dcangulo Oct 11 '18 at 03:03
  • 1
    Why do you want to know that? Are you sure this is the core of what you really need to know? – Kaiido Oct 11 '18 at 03:07
  • @Kaiido OLED displays use less energy when showing white text on dark backgrounds while LCDs use less energy with black text on white backgrounds. So … I thought I wanted to see if I could deliver a energy-tailored experience for every user. – Daniel Oct 12 '18 at 03:07

1 Answers1

0

Looks like the only option is to use an User Agent database to identify the device and use a Device database to find the corresponding display technology. Maintaining such databases requires a large effort and some of the best ones out there has either a licensing fee or a subscription based API to run queries. The complete solution is therefore likely has a substantial cost and may produce unreliable results and mistakes.

A native API or css media query would be better, but it looks like there's no such thing out there (yet).

Bence Szalai
  • 768
  • 8
  • 20