![]() ![]() Also, storing the snippets in a known place on the disk is really handy, as they could be backed up, copied directly into a project, etc. Scratchpad uses Cmd+R/Ctrl+R, which makes sense but may be reserved for reloading the page. Chrome: Keyboard shortcut to run a snippet (or part of a snippet).It is cool that it actually saves the files to a known place on your disk. Maybe if this was pulled more prominently into the UI without needing to open up a file explorer that be enough. To be fair, right now you can save scratchpad contents to a file and then ‘open’ or ‘open recent’ later. As seen in the screenshot above, it can be really handy to have a UI for storing, editing, and saving changes to the snippets. Firefox: Better management of snippets.For example, see the UI for snippet editing in Chrome: One thing I would like to see is better management of snippets (‘scratches’?). Read more about scratchpad on the Firefox developer tools documentation. In addition to being able to run an entire snippet, you can select just a portion of the code and execute it. Read more about snippets on the Chrome developer tools documentation.įirefox Scratchpad is really cool for experimenting with code. They are enabled by default in Canary, so this feature set will soon be widely available. Browser Supportįirefox has multiline support using the scratchpad editor, and Chrome has a new ‘snippets’ feature.Ĭurrently, in Chrome you have to enable snippets support in chrome://flags and inside of devtools settings (see full instructions and screenshots). Plus you can save it when you are done in case you need it later. For example, if you wrote something to help export information from a page, or print out some debugging data for your application, you can use the multiline snippet editing interface rather than typing in the console. Examples of this type of snippet would be adding jQuery to a page without it or printing the HTTP headers from the current page.Īnother use would be saving console commands that you use during development. Snippets are a much better way to handle this workflow. Then you would need to make changes to a giant single line of JavaScript inside of a bookmark manager, or use a generator to convert a. You may need to show a bookmarks bar in the UI, run it, and open up devtools to see if it worked. The problem with bookmarklets is that they are a pain to create and share, and even using them can be difficult. The actual snippets can be seen here: Why would you use snippetsĪ common usage for snippets is to replace developer bookmarklet type of functionality. ![]() You can jump straight to the devtools snippets project page and readme if you want to see some screenshots and details about each individual snippet. I have been working on a small collection of snippets that are handy to reuse inside of browser devtools. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |