page-spy-web 一个方便的web 远程调试工具

发布时间 2023-12-19 19:16:08作者: 荣锋亮

page-spy-web 一个方便的web 远程调试工具,可以实现像chrome 一样debug 远程web,同时也提供了比较专业的web 管理

运行

  • docker-compose
version: "3"
services:
  app:
    image: ghcr.io/huolalatech/page-spy-web:release
    ports:
      - "6752:6752"

web 集成使用

  • index.html
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>demo app</title>
    <script crossorigin="anonymous" src="http://localhost:6752/page-spy/index.min.js"></script>
</head>
<body>
 
    <button onclick='console.log("this is a demo")'>
       click
    </button>
    <script >
         window.$pageSpy = new PageSpy();
    </script>
 
</body>
</html>
  • server 效果


查看remote web 信息

说明

对于需要remote debug 的场景,remote 是一个不错的选择,对于h5 的开发,vConsole 是一个很不错的工具,但是缺少remote 能力,page-spy-web 是一个不错的选择

参考资料

https://github.com/HuolalaTech/page-spy-web
https://github.com/Tencent/vConsole