• 请不要在回答技术问题时复制粘贴 AI 生成的内容
hokman
V2EX  ›  程序员

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

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

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

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

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