简体   繁体   English

在全屏模式下禁用捏/缩放 IOS Safari

[英]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)我有一个 webgl 游戏在 iPad Safari 上运行良好 我可以使用通常的解决方案禁用系统捏合/缩放操作(例如: 禁用视口缩放 iOS 10+ safari? )但是在游戏切换到全屏document.body.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)

I have touch-action: none;我有touch-action: none; , user-scalable=no in meta, passive: false and e.preventDefault(); , user-scalable=no in meta, passive: false and e.preventDefault(); for all touch events (touchstart, touchend, touchmove, touchcancel)对于所有触摸事件(touchstart、touchend、touchmove、touchcancel)

Edit: here's a codepen with most things I've tried: https://codepen.io/SerialF/pen/BaaRKJN编辑:这是我尝试过的大部分内容的代码笔: 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.我在 angular 应用程序上构建的 three.js 遇到了类似的问题。 Can't figure out how to disable the exit full screen on an ipad in safari when pinch-zoom-out.无法弄清楚如何在双指缩放时禁用 safari 中 ipad 上的退出全屏。 I found that Chrome doesn't support full screen on ipad, I tried disabling touch events, e.preventDefault() on a touchstart listener.我发现 Chrome 在 ipad 上不支持全屏,我尝试禁用触摸事件,在 touchstart 侦听器上使用 e.preventDefault()。 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.我找不到调用 exitFullScreen 的位置,似乎它只是内置到操作系统中并且完全独立于 DOM。

UPDATE: Not a 100% solution but thanks to Florent for bringing this workaround to my attention.更新:不是 100% 的解决方案,但感谢 Florent 提醒我注意这个解决方法。

"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" “他们确实建议在主屏幕上添加一个快捷方式,就像所有必需的 PWA 元标记一样(请参阅此处),这是让全屏正常工作的唯一方法”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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