Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Edit Source Files Directly in Chrome ?( and keep it after refresh)

After reading this article which suppose to help with my question ( but didn't) - I still have a question .

Ok . My goal is to be able to edit downloaded scripts and keep the edit ! ( for next refresh).

Now i'm aware that it might wont work if a new timestamp is added to the file. but within my testing - the url is the exact name.

Say jQuery.com :

It downloads a script name main.js :

enter image description here

I click to edit it in the right pane , :

enter image description here

Then I save it ( notice the pink background).

I also save it in the desktop ( so it will be saved to a file system , as the article states)

But : when I refresh the page ( f5 , not ctrlf5) - I get a fresh copy without my modifications :

enter image description here

Question

What am I doing wrong ? and how can I make my modifications to stay even after refresh ?

(and besides if it shows the pink background-color as a saved , file .... saved where ? why the changes are not saved ")

nb : chrome ver 35.0.1916.153 m

like image 582
Royi Namir Avatar asked Jun 18 '14 10:06

Royi Namir


People also ask

How do I save an edited source code?

Save: Save your changes and exit the source editor. To save without exiting the editor, use Ctrl+S (PC) or Cmd+S (Mac).

How do I save edited HTML in Chrome?

Edit Your Code Editing in Chrome is super easy. You can locate your line of edit by pressingCtrl+Shift+O for Windows / Cmd+Shift+O for Mac. After editing press Ctrl+s on Windows or Cmd+s on Mac to save the file.

How do you edit a website source?

Open any web page inside Chrome and select the text on the web page that you wish to edit. Right-click the selected text and choose Inspect Element in the contextual menu. The developer tools will open in the lower half of your browser and the corresponding DOM element will be selected.


2 Answers

I think the critical point here is that the site you're editing needs to be served locally. Unless you're actually serving api.jquery.com from your own computer, your saved changes will be lost when you refresh.

You should save the files you're working on to your computer and open them in Chrome. Then follow the article's directions. When you right-click 'Save As', save it to the same place on disk that the file is being served from.

like image 86
Paul B Avatar answered Sep 18 '22 23:09

Paul B


I have achieved a quite similar work flow using this tutorial

You can also use Chrome's extension for autosave

More detailed instructions can be found here: http://github.com/NV/chrome-devtools-autosave

Note that you can edit your own files only, and that a server like setup is required

like image 24
vorillaz Avatar answered Sep 21 '22 23:09

vorillaz