【问题标题】:Android System WebView 85.0.4183.81 - touchmove event is only firing at 3fpsAndroid System WebView 85.0.4183.81 - touchmove 事件仅以 3fps 触发
【发布时间】:2020-08-29 16:33:16
【问题描述】:

昨天我在 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

您可能无法在此处测试 sn-p,因此您可以在此处进行测试:https://ghost.sk/touch.html 不要在 chrome for android 中测试,因为它有自己的 webview 版本,没有这个错误。 有没有办法解决这个问题?

编辑:解决方法是首先接受的答案,但这是一个真正的问题,这里是相关的错误报告:https://bugs.chromium.org/p/chromium/issues/detail?id=1123304

【问题讨论】:

标签: android webview


【解决方案1】:

经过数小时的研究,我找到了解决方案 (https://bugs.chromium.org/p/chromium/issues/detail?id=1072364):

尝试在touchmove 事件中添加preventDefault()

    var n = 0;
    window.addEventListener('touchmove', function (e) {
        n++;
        document.body.textContent = n;
        e.preventDefault();
    }, {passive: false});

【讨论】:

  • 我还需要在 addEventListener 中添加 {passive:false} 作为第三个参数
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2018-10-05
  • 1970-01-01
  • 1970-01-01
  • 2021-04-28
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多