Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to reload a single Javascript file using Chrome Developer tools?

In many cases, I make some small changes to a JavaScript file, to see the result I have to reload the whole page.

Changes made in chrome's developer tool in "Source" tab do not save in file system.

So, is it possible to reload single JavaScript file alone?

like image 564
saravanabawa Avatar asked Dec 14 '16 07:12

saravanabawa


People also ask

Can I edit JavaScript in Chrome dev tools?

View and edit files, create Snippets, debug JavaScript, and set up Workspaces in the Sources panel of Chrome DevTools.

Where is the reload button in Chrome developer tools?

Just open the Chrome Dev Tools by pressing F12. Once the chrome dev tools are open, just right click on the refresh button and a menu will drop down. This menu gives you the option of doing a hard refresh, or even clearing the cache and do a hard refresh automatically.


1 Answers

I can't think of much efficient way to do this but one way you can do this is by adding a breakpoint at the start of the JavaScript file or at the block you want to add or delete changes to.

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 here's a thing that you should know: next reload the changes will vanish but at least it let's you run some slightly modified JavaScript client side codes.

like image 74
Nitin Prakash Avatar answered Oct 06 '22 23:10

Nitin Prakash