Performance, debugging and testing code snippets to be run in Chrome DevTools
Note: code snippets do NOT have access to the full console API, for example no access to
All snippets, including mine are distributed under MIT license.
You can update local code snippets by downloading new versions from this github repository. Create a new code snippet and copy the source from update-code-snippets.js.
Note: the approach below does not work any more, see the open issue.
You will run this code snippet in an unusual way. First, open any web page, even an empty tab.
Open the DevTools in undocked mode (Command+Option+I on Mac). Then open the DevTools again,
while focused on the first DevTools. This will open the second DevTools instance with the source for the
first DevTools panels. If you inspect the
localStorage variable in the second DevTools window, you will
find lots of interesting stuff, including all the code snippets in the
Whenever you want to update the your local code snippets in the Chrome DevTools, execute the
snippet in the second DevTools instance. The update script looks at the your current code snippets and
tries to download a file with same name from the code snippets github repository (via RawGit).
If the remote file has been downloaded successfully, it will replace the snippet.
After all snippets are checked, reopen the DevTools to load the updated source code.
Note, that only the latest source is downloaded, not any particular release.
Also, only code snippets with names matching existing files in this repo are replaced. If you do not
want to override a code snippet - just rename it, for example, remove the
You can download and run a single snippet by using the following boilerplate (scripts are via downloaded via RawGit)
Author: Gleb Bahmutov © 2014
License: MIT - do anything with the code, but don't blame me if it does not work.
Spread the word: tweet, star on github, etc.
Support: if you find any problems with this module, email / tweet / open issue on Github