V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
hokman
V2EX  ›  程序员

前端单步调试遇到难题: chrome devtools 不能对网页内置的 js 进行 pretty print

  •  
  •   hokman · 2023-09-10 13:08:29 +08:00 · 996 次点击
    这是一个创建于 372 天前的主题,其中的信息可能已经有所发展或是发生改变。

    不能 pretty print 就很难进行单步调试。有啥办法么?

    5 条回复    2023-09-11 16:30:41 +08:00
    Rache1
        1
    Rache1  
       2023-09-10 13:21:45 +08:00
    这个?

    hokman
        2
    hokman  
    OP
       2023-09-10 13:31:43 +08:00
    @Rache1 我点了这个的,还是没法进行对齐。对单独的 js 文件是有效的,对 html 和 js 混排的好像无效。
    Pastsong
        3
    Pastsong  
       2023-09-10 15:00:35 +08:00 via Android
    没对齐是 sourcemap 的问题,Chrome 里单纯 pretty print minified code 是不可能执行对不齐的
    LykorisR
        4
    LykorisR  
       2023-09-10 21:49:24 +08:00
    chrome devtool 的有时候会出问题,可以尝试下 https://unminify.com/
    hokman
        5
    hokman  
    OP
       2023-09-11 16:30:41 +08:00
    @Pastsong 那么有什么办法让它能仍然对齐并可以单步调试吗?
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   941 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 19:38 · PVG 03:38 · LAX 12:38 · JFK 15:38
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.