![]() # Open the Snippets pane with a mouseĬlick the Sources tab to open the Sources panel. When you want to edit a Snippet, you need to open it from the Snippets pane.įigure 3. How the page looks after running the Snippet. The Console Drawer pops up to display the Hello, Snippets! message that the Snippet logs, and the page's content changes completely.įigure 2. createElement ( 'p' ) įigure 2 shows how the page looks after running the Snippet. Here's the Snippet source code from Figure 1: console. How the page looks before running the Snippet. ![]() ![]() Firefox DevTools has a feature similar to Snippets called Scratchpad.įor example, Figure 1 shows the DevTools homepage on the left and some Snippet source code on the right.įigure 1. Snippets are an alternative to bookmarklets. They have access to the page's JavaScript context, and you can run them on any page. Snippets are scripts that you author in the Sources panel. If you find yourself running the same code in the Console repeatedly, consider saving the code as a Snippet instead.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |