android - Android System WebView 85.0.4183.81 - touchmove 事件仅以 3fps 触发
问题描述
昨天我在 Android 10 手机上将 Android System WebView 更新为 85.0.4182.81。之前,touchmove 事件触发 100 fps 左右,非常流畅。现在它就像 3 FPS。
var n = 0;
window.addEventListener('touchmove', function () {
n++;
document.body.textContent = n;
});
Touch and move here
您可能无法在此处测试代码片段,因此您可以在此处对其进行测试:https ://ghost.sk/touch.html 不要在 chrome for android 中进行测试,因为它有自己的 webview 版本而没有此错误。有没有办法来解决这个问题?
编辑:解决方法是第一个接受的答案,但这是一个真正的问题,这里是相关的错误报告:https ://bugs.chromium.org/p/chromium/issues/detail?id=1123304
解决方案
经过几个小时的研究,我找到了一个解决方案(https://bugs.chromium.org/p/chromium/issues/detail?id=1072364):
尝试添加一个preventDefault()
事件touchmove
:
var n = 0;
window.addEventListener('touchmove', function (e) {
n++;
document.body.textContent = n;
e.preventDefault();
}, {passive: false});
推荐阅读
- lua - 函数“fwd_prop_enc”中的错误:尝试调用全局“转发”(零值)
- php - 根据元素位置创建新数组
- python - Pandas 将特定列乘以行中的值
- javascript - 使用 Selenium、jQuery 和 RFT 的自动化数据更改触发问题
- django - 具有多个嵌套模型性能的 Django 插入
- python - 如何使用 django_graphene 解析 django 模型的自定义字段?
- java - Java WSDL DHL 类
- python - 我可以使用具有不同图像尺寸的 `tf.layers.conv3d` 吗?使用“无”而不是固定整数?
- azure-devops - 如何在构建管道执行过程中设置环境变量?
- unity3d - 统一从android目录加载音频文件?