OMBD#6: Running Code Snippets on Chrome’s Console
Welcome to issue #6 of One Minute Better Developer, where you become a more successful software developer by reading short nuggets of knowledge, one minute at a time.
You want to test a registration form on a website. Instead of filling it up manually every time, you may come up with a snippet like this that does it automatically for you:
Now, instead of copy-pasting it over and over, it would be great if we could store it on the browser so when we want to use it we can retrieve it and run it easily.
Fortunately, Chrome’s DevTools provide functionality for this: snippets.
- Open Chrome’s DevTools.
3. Type “show snippets” and select that option
4. This will reveal the Snippets tab under the sources panel.
+ New snippet
5. Name your snippet and input its content on the right-hand panel.
Now that your snippet is saved, you can press ctrl/cmd + enter to run it on the page!
Snippets will persist between browser sessions, so you can retrieve and run them easily.
BONUS: here’s a list of snippets to get you inspired.
If you liked this article, you may also like:
1 Minute To Become A Better Developer (#5)
Welcome to issue #5 of this series, where you become a more successful developer by reading short nuggets of knowledge…
1 Minute To Become A Better Developer (#7)
Welcome to issue #7 of this series, where you become a more successful developer by reading short nuggets of knowledge…