Zoom Firefox

Just starting out? Need help? Post your questions and find answers here.
Stefan
Posts: 248
Joined: Mon Feb 05, 2018 9:44 pm

Zoom Firefox

Post by Stefan »

Unfortunately, zooming with Javascript does not work with Firefox.

Code: Select all

  !document.body.style.zoom =0.5 / window.devicePixelRatio * 100 + "%"
   !v_width=document.body.clientWidth;
   !v_height=document.body.clientHeight;
does does not work.

Does anyone have any idea how to do this in Firefox?
pecket
Posts: 4
Joined: Wed Jun 26, 2019 6:32 pm

Re: Zoom Firefox

Post by pecket »

Since Firefox doesn't support the zoom function, you can instead use scale to obtain the same result. Tampered a bit around with this, and I'm a complete JS novice so I apologize if there is a bug somewhere I haven't thought of, but you could try this instead:

Code: Select all

!document.body.style.transformOrigin = 'top left';
!document.body.style.transform = 'scale(' + (0.5 / window.devicePixelRatio) + ')';
!v_width=document.body.clientWidth;
!v_height=document.body.clientHeight;
Post Reply