Predefined snippets

Published on Updated on

DevTools - Run predefined snippets of code on any web page.

A feature called Snippets is present in the DevTools which allows you to save (or remove) bits of code which can be run on a webpage (it's just a bit more convenient than re-typing JavaScript code in the console panel). To try it:

  • Go to Sources > Snippets (it's in the left sidebar)
  • Right click in the snippets window and select New
  • Enter a file name and your desired snippet
  • Right click on the snippet and select Run (or Ctrl/Cmd + Enter)

You'll also notice it has multi-line editing and confirmation for exit-without-saving.

Snippets source: https://github.com/bgrins/devtools-snippets

Updated on Improve article

Back

Perform a column selection by by dragging

Next

Quick-edit element tags

This site uses cookies to deliver and enhance the quality of its services and to analyze traffic. If you agree, cookies are also used to serve advertising and to personalize the content and advertisements that you see. Learn more about our use of cookies.