detect-zoom
detect-zoom copied to clipboard
should use screen.width/window.innerWidth for chrome
because window.outerWidth ( and outerHeight) is not correct at page load or orientation change on android.On iOS, outerWidth seems to be 0.
because window.outerWidth ( and outerHeight) is not correct at page load or orientation change on android.On iOS, outerWidth seems to be 0.
On non-maximized windows, you can detect browser zoom level(which is independent of system dpi) by resizing window and observing difference in ratio of change between innerWidth
/innerHeight
and outerWidth
/innerHeight
.