detect-zoom
detect-zoom copied to clipboard
Invalid zoom level in FF 18.0.2 for Mac with retina display
At 100% zoom I'm getting:
Current zoom level: 2.00
Device Pixel Aspect Ratio: 2.00
I know. I also mention it in the readme - Mozilla's implementation makes it impossible (at least until someone finds a workaround) to defer between zoom level and devicePixelRatio.
I'm still pondering about this issue...
Sent from my iPhone
On Feb 17, 2013, at 0:13, zdmytriv [email protected] wrote:
At 100% zoom I'm getting:
Current zoom level: 2.00 Device Pixel Aspect Ratio: 2.00
— Reply to this email directly or view it on GitHub.
Is there any other way to detect that it is a retina screen? I suppose you could then expect the zoom to come out as 2.00 and then adjust it behind the scenes back to 1.0 and thus only if the zoom reads more or less than 2.0 would it have a non 1.0 zoom.
Just thinking out loud here. I sadly don't have a retina display to test with, or I would try and figure out a way around the issue since the FF devs are being pretty stubborn here: https://bugzilla.mozilla.org/show_bug.cgi?id=809788
yeah, I know. comments 22 and 24 there are mine...
On Feb 27, 2013, at 21:19 , Robert Schultz [email protected] wrote:
Is there any other way to detect that it is a retina screen? I suppose you could then expect the zoom to come out as 2.00 and then adjust it behind the scenes back to 1.0 and thus only if the zoom reads more or less than 2.0 would it have a non 1.0 zoom.
Just thinking out loud here. I sadly don't have a retina display to test with, or I would try and figure out a way around the issue since the FF devs are being pretty stubborn here: https://bugzilla.mozilla.org/show_bug.cgi?id=809788
— Reply to this email directly or view it on GitHub.
FYI - This issue is occurring for me with Chrome Version 25.0.1364.172 m on a Dell U2711 monitor with Windows 7. DPI is 109ppi with an overall resolution of 2560x1440. Firefox works fine for me; I tested 16.0.1, 18.0.1 and 19.0.2.
In the latest firefox you want to make this change
@@ -189,8 +189,9 @@
* @private
*/
var firefox18 = function () {
+ var zoom = Math.round(((window.outerWidth) / window.innerWidth)*100) / 100;
return {
- zoom: firefox4().zoom,
+ zoom: zoom,
devicePxPerCssPx: devicePixelRatio()
};
};