Tuesday, December 5, 2017

Editing in the Chrome debugger

I came across this today, when I was playing around with someone else's website.
I realized I could attach a break-point in the debugger to some line of code before what I wanted to dynamically edit. And since break-points stay even after a reload of the page, I was able to edit the changes I wanted while paused at break-point and then continued to let the page load.
So as a quick work around, and if it works with your situation:
  1. Add a break-point at an earlier point in the script
  2. Reload page
  3. Edit your changes into the code
  4. CTRL + s (save changes)
  5. Unpause the debugger
----------------------
 If you have the file prettified, Chrome will not allow edits. I turned it off and was able to edit. Willing to bet this is/was your problem.
Chốt:
  1. Đặt breakpoint
  2. Ctrl+F5
  3. Edit javascript
  4. Ctrl+S
Chú ý: (2017/12/06)
  • những file gốc (có dạng http://path/to/file.js) => được Edit
  • những file đã được chrome format lại cho đẹp và dễ nhìn dễ đọc code (có dạng http://path/to/file.js:formatted) => KHÔNG được edit

 

No comments:

Post a Comment