Live Editing Remote JavaScript in Chrome Inspector

I am trying to debug remote javaScript using Google Chrome inspector. I remember that in the past I could:

1) Edit remote javascript using Chrome Inspector 2) 'Save' the change using (cmd + s) 3) Test the effect the the altered javaScript on the page 

Now when I try to “save” the change, I get a yellow warning icon on the tab that says

 "Changes to this file were not saved to the file system" 

Can someone help me with this, please remember that I am working with remote code (not trying to change local files) and I have a developer extension.

+6
source share
3 answers

The changes were not saved to disk because you obviously cannot access the remote js file, but they will take effect when javascript reaches these lines of code.

You can add a breakpoint in front of the place where you want to dynamically add the code, reload the page, add the desired code and press ctrl-s. Ignore the warning you mention about the file system and enjoy.

So you can follow these steps and just ignore the warning.

+1
source

UPDATE . In the link below, the documents have been moved here .

To do this, you need to create workspaces. Read the docs on how to use workspaces: https://developer.chrome.com/devtools/docs/workspaces

0
source

For everyone who came across this, like me ...

For local files

You may need to run chrome as an administrator. Or in my case (Ubuntu) as root user.

 sudo google-chrome --no-sandbox 

Then you can save the files in devtools.

0
source

Source: https://habr.com/ru/post/975905/


All Articles