相关链接
直接在共用js方法中直接添加
var style = document.createElement('style');
style.type = 'text/css';
var cssContent = document.createTextNode('body{-webkit-user-select:none;-webkit-user-drag:none;}');
style.appendChild(cssContent);
document.body.appendChild(style);
document.documentElement.style.webkitUserSelect = 'none';
document.documentElement.style.webkitTouchCallout = 'none';

本文介绍了一种方法来禁用iOS应用中的WKWebView长按功能。通过在JavaScript中添加CSS样式,可以阻止用户长按时出现的默认上下文菜单,包括针对超链接、图片和文本等元素。

被折叠的 条评论
为什么被折叠?



