Window.devicePixelRatio read-only property returns the ratio of the (vertical) size of one physical pixel on the current display device to the size of one CSS pixel. Note that as the page is zoomed in the number of device pixels that one CSS pixel covers increases, and therefore the value of
devicePixelRatio will also increase.
There are no callbacks or events to listen to when this value changes (for example, if you drag the window between displays with different densities).
value = window.devicePixelRatio;
- PPK made some research on devicePixelRatio