In bash, I use the history-search-forward and history-search-backward feature to allow me to type in a few characters of the command I want to run, then press up arrow to cycle through items in my history that match those characters.
I want the same thing for the chrome devtool console. I often use up arrow to cycle through my history, but there doesn't seem to be a way to filter it. Does anybody have a clever solution?
[Just a note that command history matching has improved a lot in recent versions of Chrome. It's not exactly how I would like it, but it's pretty good.]
Google chrome gives you the ability to filter out messages within the console by prefixing a search term with the hyphen-minus (subtraction) character - . If you want to ignore multiple entries, add a space between the search terms.
Console Logs in Chrome: In Google Chrome, the Console Logs are available as a part of Chrome Dev Tools. To open the dedicated Console panel, either: Press Ctrl + Shift + J (Windows / Linux) or Cmd + Opt + J (Mac).
Use the short cut Ctrl + L to clear the console. Use the clear log button on the top left corner of the chrome dev tools console to clear the console.
Reverse search feature is not there in Chrome developer tools. I have logged a request for the reverse search feature. Please star the same.
http://code.google.com/p/chromium/issues/detail?id=171386
I use Snippets (Chrome Developer Tools: What is Snippets Support?) for keeping track of all my commands.
Try this: (based on How to remove all recent console command)
JSON.parse(localStorage.getItem('consoleHistory')).filter(function(item){ return ~item.indexOf('indexedDB');})
TL;DR
LocalStorage
of the original Dev Tools is for the site you are browsing.LocalStorage
for the Dev Tools window and thus gives you access to the consoleHistory
.localStorage.getItem('consoleHistory')
gives you a string of an Array, so you need to parse it (i.e. JSON.parse()
) back into an Array
so you can filter
it. ~
in front of ~item.indexOf('indexedDB')
is a bitwise shortcut for item.indexOf('indexedDB') > 0
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With