'Disable pinch / zoom in IOS Safari while being in fullscreen
I have a webgl game working fine on iPad Safari
I can disable system pinch / zoom actions with usual solutions (like this one: disable viewport zooming iOS 10+ safari?)
But I can't get any to work after the game is switched to fullscreen with document.body.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)
I have touch-action: none;
, user-scalable=no
in meta, passive: false
and e.preventDefault();
for all touch events (touchstart, touchend, touchmove, touchcancel)
Edit: here's a codepen with most things I've tried: https://codepen.io/SerialF/pen/BaaRKJN
Solution 1:[1]
Have you made any progress on this? I am running into a similar issue with a three.js built on angular application. Can't figure out how to disable the exit full screen on an ipad in safari when pinch-zoom-out. I found that Chrome doesn't support full screen on ipad, I tried disabling touch events, e.preventDefault() on a touchstart listener. I can not find where the exitFullScreen is being called, seems like it's just built into the OS and is completely independent from the DOM.
UPDATE: Not a 100% solution but thanks to Florent for bringing this workaround to my attention.
"They do suggest to add a shortcut to home screen, as with all the required PWA meta-tags (see here), this is the only way to have fullscreen working properly"
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 |