vconsole 4s 埋点

<script src="static/js/vconsole.min.js"></script>
<script>
  (function () {
    var start, timer
    var initVConsole = (function () {
      var instance
      return function () {
        if (!instance) {
          var info = window.console.info
          window.console = new VConsole()
          window.console.info = info
          instance = window.console
        }
        return instance
      }
    })();

    window.addEventListener('touchstart', function () {
      start = Date.now()
      timer = setInterval(function () {
        console.log(Date.now() / 1000)
      }, 1000)
    })
    window.addEventListener('touchend', function () {
      if ((Date.now() - start) > 3000) {
        console.log(initVConsole())
      }
      clearInterval(timer)
    })
  })();
</script>
评论数量: 0

0
点赞
14
浏览
0
评论

贡献 46