阻止下拉刷新

阻止前进后退手势

代码片段
6 行
/* currently there is NO SIMPLE WAY to prevent BackForwardNavigationGestures for Safari */

/* prevent "overscroll history navigation" for Chrome 63+ */
body{
  overscroll-behavior-x: none;
}

禁止手势缩放

代码片段
5 行
/* prevent pinch-zoom for Chrome 36+, Safari 13+ */
html {
  touch-action: pan-x pan-y;
  min-height: 100%; /* for Safari */
}
JavaScript
4 行
// prevent pinch-zoom for iOS Safari 9~12
if (window.GestureEvent && !('touchAction' in document.documentElement.style)) {
  document.documentElement.addEventListener('gesturestart', (e)=>{e.preventDefault()}, {passive: false, capture:true});
}
代码片段
2 行
<!-- prevent pinch-zoom for Chrome, old Safari -->
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" />

禁止双击缩放

禁止iOS Safari其他默认行为

禁止长按选中文本

代码片段
1 行
-webkit-user-select: none;

禁止长按弹出上下文菜单

代码片段
1 行
-webkit-touch-callout: none;

禁止按钮/链接点击特效

代码片段
1 行
-webkit-tap-highlight-color: transparent;

禁止长按弹出上下文菜单

代码片段
1 行
-webkit-touch-callout: none;

禁止视频弹出悬浮窗口

代码片段
1 行
<video playsinline></video>