Chrome Dev Tools - Modify javascript and reload

CDT picture CDT · May 11, 2013 · Viewed 141.2k times · Source

Is it possible to modify the JavaScript of a page and then reload the page without reloading the modified JavaScript file (and thus losing modifications)?

Answer

Ashley Schroder picture Ashley Schroder · Jun 9, 2014

This is a bit of a work around, but one way you can achieve this is by adding a breakpoint at the start of the javascript file or block you want to manipulate.

Then when you reload, the debugger will pause on that breakpoint, and you can make any changes you want to the source, save the file and then run the debugger through the modified code.

But as everyone has said, next reload the changes will be gone - at least it let's you run some slightly modified JS client side.