简体   繁体   中英

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

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"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM