Chrome JavaScript Debugging - how to save break points between page refresh or break via code?

前端 未结 8 762
情深已故
情深已故 2021-01-31 06:46

When using Chrome and it\'s JavaScript debugger, every time I reload my page / scripts, my breakpoints are lost and I have to go find the script file in the pop-up, find the lin

8条回答
  •  旧时难觅i
    2021-01-31 07:21

    Also, do you send your JavaScript file(s) from the server to the client with an attached query parameter to the URL with the current Epoch time? This is used to prevent caching of the JavaScript file(s).

    When this is the case, it seems like the Chrome Developer Tools interprets the file to be a different one after the refresh, which will (correctly) remove the breakpoints.

    For me, removing the query parameter made the CDT keep the breakpoints after refresh.

提交回复
热议问题