Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to Live Edit Javascript in Chrome Developer Tools

I have done this a million times, i.e open the javascript file in the "Sources" tab, edit and hit CTRL+S to save it, upon which Chrome would confirm the same with a "Recompilation and Update Succeeded".

But I can no longer do this! There is no confirmation message in the console.

Also, the source window turns reddish indicating failure to do so.

The same script is getting edited from a different system.

I am on Chrome 41.0.2272.101m / WIN8.

The script is not "prettified", just to rule that answer out.!

like image 955
Neo Avatar asked Mar 24 '15 12:03

Neo


People also ask

Can you 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. Learn how to use Chrome DevTools to find and fix JavaScript bugs.

How do I enable JavaScript on Chrome dev tools?

To re-enable JavaScript: Open the Command Menu again and run the Enable JavaScript command. Close DevTools.

Can you see JavaScript in Chrome developer tools?

Select the Chrome Menu icon, menu -> More Tools -> JavaScript Console. Or if the Chrome Developer Tools are already open, press the 'Console' tab.


1 Answers

Try using workspaces: https://developer.chrome.com/devtools/docs/workspaces

Add the project folder as a workspace in devtools by right-clicking in the left panel in Sources and choosing "Add Folder to Workspace".

Afterwards, select the javascript file from the folder in your workspace. Right-click anywhere within the file to choose "Map to Local Resource" and select the live file that matches the current file in your workspace.

This should allow you to update your JS file and any saved changes will be applied to the current page without refreshing.

like image 116
micjamking Avatar answered Sep 18 '22 15:09

micjamking