V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
• 请不要在回答技术问题时复制粘贴 AI 生成的内容
hokman
V2EX  ›  程序员

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

  •  
  •   hokman · Sep 10, 2023 · 1471 views
    This topic created in 959 days ago, the information mentioned may be changed or developed.

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

    5 replies    2023-09-11 16:30:41 +08:00
    Rache1
        1
    Rache1  
       Sep 10, 2023
    这个?

    hokman
        2
    hokman  
    OP
       Sep 10, 2023
    @Rache1 我点了这个的,还是没法进行对齐。对单独的 js 文件是有效的,对 html 和 js 混排的好像无效。
    Pastsong
        3
    Pastsong  
       Sep 10, 2023 via Android
    没对齐是 sourcemap 的问题,Chrome 里单纯 pretty print minified code 是不可能执行对不齐的
    LykorisR
        4
    LykorisR  
       Sep 10, 2023
    chrome devtool 的有时候会出问题,可以尝试下 https://unminify.com/
    hokman
        5
    hokman  
    OP
       Sep 11, 2023
    @Pastsong 那么有什么办法让它能仍然对齐并可以单步调试吗?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1056 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 23:18 · PVG 07:18 · LAX 16:18 · JFK 19:18
    ♥ Do have faith in what you're doing.