I want to find the ratio between CSS pixels and device pixels.
Edit: I should have realized that this is just zoom level. I\'ve added an answer to t
You can use window.devicePixelRatio in Webkit based browsers to get the device pixel ratio directly in JavaScript. I have used this on Google Chrome, Android browsers (2.2+) and Mobile Safari. I have no idea about other browsers though.
window.devicePixelRatio