Page 1 of 1

Zoom Firefox

Posted: Thu Jun 29, 2023 6:24 am
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?

Re: Zoom Firefox

Posted: Tue Jul 04, 2023 9:50 am
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;