Closed
Description
window.devicePixelRatio
includes both the device scale and the page zoom. However, there is no easy way to get the page zoom factor alone.
Developers use different ways to get the zoom factor, but they are either inaccurate or not specced
(e.g window.outerWidth / window.innerWidth, and window.getComputedStyle()['zoom'])
In addition, as mentioned in this comment, event.screenX/Y
are in DIP(device independent pixels), which includes zoom, and clientX/Y
are in CSS pixel. Lacking page zoom factor causes developer having trouble converting between the coordinates spaces.
I therefore propose adding a new window.pageZoomFactor to expose the zoom factor.