Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change JavaScript files on Google Chrome's Developer Tools [closed]

I know how to use JavaScript on Google Chrome's console.

But is it possible to edit JavaScript files from within Google Chrome's developer tools and see the changes immediately? If so, how?

I have tried changing the code, but it has no effect on the page.

like image 885
GangstaGraham Avatar asked Feb 25 '13 04:02

GangstaGraham


People also ask

Can I edit JavaScript in Chrome DevTools?

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


2 Answers

You can edit javascript of the page. You had to make a double click in the old version of chrome or in the recent version you need to make a single click in js file. After that you need to press Ctrl+S or Cmd+S on Mac. Then DevTools will send the changed code to V8.

If you are in a debug session and stay on a pause in a function you can edit it and after Ctrl+S v8 will move the execution point out from the edited function so you will be able to pass it again.

like image 143
loislo Avatar answered Sep 20 '22 16:09

loislo


You could redefine a global function or change the value of a variable in scope, but I'm not aware of any way in the Chrome Dev Tools to edit your code while live. I edit, then hit refresh.

You can live edit CSS in the Sources tab.

like image 34
jfriend00 Avatar answered Sep 18 '22 16:09

jfriend00