Using information collected mainly on this issue: In the browser browser, "zoom in" in JavaScript
I played with trying to track browser zoom for the last day or so, and it's about as close as you can get without the standard onZoom event, which you can kill.
document.observe('keydown', function (ev) { var key, keys = ['0']; var isApple = (navigator.userAgent.indexOf('Mac') > -1), isCmmd, isCtrl; if (window.event) { key = window.event.keyCode; isCtrl = window.event.ctrlKey ? true : false; isCmmd = window.event.metaKey ? true : false; } else { key = e.which; isCtrl = ev.ctrlKey ? true : false; isCmmd = ev.metaKey ? true : false; } if (isCtrl || (isCmmd && isApple)) { switch (key) { case 48:
Unfortunately, I have been playing with this for a while now, and there is no surefire way to really disable it. Scaling options are still available in the main application menus, so thereβs a real way to track scaling (including after reloading the page, which is basically impossible now, and in addition, webkit shows odd behavior when trying to track the increase).
Despite the fact that many people would like to keep a hidden snapshot of the browser, I personally can see the possible advantages associated with the ability to scale separately from resizing, because at the moment they are in most cases indistinguishable (and this, if not for any other reason in general).
Adam eberlin
source share