Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
As of version 19, Chrome's Web Inspector has an experimental feature called "snippets support". Here is how to activate it:
Open chrome:flags, enable "Developer Tools experiments", restart.
Open Web Inspector (Developer Tools), hit the settings gear icon in the lower right corner, enable "Snippets support", restart.
Open the Scripts panel, click the "navigator tree" icon on the left, and find an empty Snippets tab.
My question is:
What can I use this for? How can I populate this with snippets?
–
In short, snippets are a multi-line console, an iterative JS development workflow, and a persistent store for common debugging helpers.
developers.google.com/chrome-developer-tools/docs/authoring-development-workflow#snippets
Some of the use-cases Snippets can help with are:
Bookmarklets
- all of your bookmarklets could be stored as snippets, especially those you may wish to edit.
Utilities
- debugging helpers for interacting with the current page can be stored and debugged. A community-curated list of such utilities is available.
Debugging
- Snippets offer a multi-line console with syntax-highlighting and persistance, making it convenience for debugging code that is more than a one-liner.
Monkey-patching code
- code you wish to patch at runtime can be done through Snippets, although many times you can just live-edit code in the Sources tab.
Lastly, I've personally been collecting a few common snippets that you may include in your arsenal:
github.com/paulirish/devtools-addons/wiki/Snippets
To run snippets quickly, now you can do this. Ctrl-Shift-P for the "command palette", then backspace, and use a ! prefix, then type whichever snippet name you want to run.
–
–
–
–
–
–
–
–
–
I'm unable to activate that experiment myself (there's no
Developer Tools experiments
in my
chrome:flags
, but from Safari, I found
this
explanation:
In short, it "is a little utility that allows you to enter blocks of HTML and CSS and have it rendered on the fly".
From the blog post, it seems it is buggy in Safari, so maybe Chrome has not implemented it yet.
Thanks for contributing an answer to Stack Overflow!
-
Please be sure to
answer the question
. Provide details and share your research!
But
avoid
…
-
Asking for help, clarification, or responding to other answers.
-
Making statements based on opinion; back them up with references or personal experience.
To learn more, see our
tips on writing great answers
.