Autosaving to files in Chrome Dev Tools
-
22-06-2021 - |
Вопрос
I'm watching this Chrome Dev Tools evolution video from Google IO 2012 and then saw this tools called Chrome Dev tools autosave which autosaves the file that is edited from chrome dev tools. I'm on Windows and already have node installed so I only did the following:
- Install the devtools autosave from here: https://chrome.google.com/webstore/detail/mlejngncgiocofkcbnnpaieapabmanfl/details
Installed the server:
npm install -g autosave
Everything was installed as it says itsrunning on http://127.0.0.1:9104
Created a routes.js file and saved it to the folder where I run the installation of the server. Here's what the routes.js file looked like:
exports.routes = [{ from: /http:\/\/127.0.0.1\//, to: 'D:\/web_files/' }];
Apparently accessing localhost
from Chrome doesn't work(it only works on firefox and other browsers I don't know why) so I have 127.0.0.1
in there instead of localhost
And I have this one on the options from the chrome extension:
Any idea what I have missed? It's not working as I tried modifying some styles in a file at:
http://127.0.0.1/tester/css/css1.html
Решение
First of all, you don’t need routes.js file. It is not necessary in Autosave version 1.x.
How does the URL of the CSS stylesheet look like? Note that Autosave doesn’t yet work for inline stylesheets (included via <style>
).
Другие советы
I am a Mac OSX user and I had to install nodejs for autosave to work. These are the steps that I followed : 1)Install nodejs 2)Run this command in terminal
sudo npm install -g autosave
sudo npm run-script -g autosave autostart
3)Enable Experimental Extension API 4)Install AutoSave Extension from chrome extensions 5)close chrome, restart laptop
You can validate if autosave is working by typing 'autosave' in terminal and you will get something like this :
saba$ autosave
http://127.0.0.1:9104 is already in use. Exiting.
TADA!! you are ready to use Autosave.