didi / cube-ui

:large_orange_diamond: A fantastic mobile ui lib implement by Vue
https://didi.github.io/cube-ui/
Apache License 2.0
9.14k stars 1.47k forks source link

window.performance.timing.navigationStart有bug #678

Open 303182519 opened 4 years ago

303182519 commented 4 years ago

Version

1.12.36

Reproduction link

https://aq.huya.com/m/third_bind/third_bind.html

Steps to reproduce

发现你们的库里面用到window.performance.timing.navigationStart这个方法,在sentry的监控下,发现在IOS报null is not an object (evaluating 'window.performance.timing.navigationStart')

What is expected?

未知

What is actually happening?

未知

Dependencies Version

vue: 2.6.11 better-scroll: 1.15.0

dolymood commented 4 years ago

这个貌似是 bs 的bug 目前来看的话 只能先 hack 处理掉 As https://github.com/ustbhuangyi/better-scroll/issues/841

if (!performance.timing) {
  performance.timing = {}
  Object.defineProperty(performance.timing, 'navigationStart', {
    get: function () {
      return Date.now() - performance.now()
    }
  })
}