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

前端 未结 8 749
情深已故
情深已故 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条回答
  • 2021-01-31 07:37

    Set your breakpoints, switch to the Network tab and select the Preserve Log Upon Navigation toggle button. Now the breakpoints should be there when you refresh.

    Or the JavaScript way is to use

    debugger;
    
    0 讨论(0)
  • 2021-01-31 07:42

    For people using ExtJs 6.x:
    instead of disableCaching in the Ext.Loader you could add a "cache" or "disableCacheBuster" query parameter to the page's URL. This will remove the "_dc" parameter from the file and enable chrome debugger to persist the breakpoint.

    See bootstrap.js in your application (config parameter disableCaching).

    0 讨论(0)
提交回复
热议问题