How to remove all recent console command

点点圈 提交于 2019-11-26 07:25:03

问题


to using commands that were previously submitted by bringing focus to the console and pressing up/down key on it. I want to remove all of the recent command. I\'ve tried this command :

console.clear(); 

but it\'s still not working properly. I even clean the whole cookies and cache in the browser. but these commands still there on the console. does anyone know how?


回答1:


If you want to clear the list of last typed commands, follow these steps:

(Step 1 and 2 are important, don't skip them!)

  1. Undock the console (click on the icon in the bottom-left corner,

    ).
    (if you don't see

    , but

    , then hold the mouse pressed for a few seconds to get the desired icon)
  2. Press Ctrl + Shift + J to open the console for this console. (On OSX use Cmd + Option + i)
  3. Go to the Resources tab, "Local Storage", chrome-devtools://devtools.
  4. Right-click on the item with key "consoleHistory", and choose "Delete".

  5. Done! You may close the new console, and then dock the previous one if wanted. The console history will be gone when you reload the console.

If you just want to clear the console log (not the commands), just press Ctrl + L.

You could also use Incognito mode if you don't want to keep the list of commands you're going to type.




回答2:


You can now just right click on the console area and select "Clear console history".




回答3:


I found a quick way to do this with cool keyboard shortcut:

Inside chrome console

  1. Press Ctrl + Shift + P
  2. You will see this awesome command palette opened:

  3. type clear and you will find it :)

That's it!




回答4:


If you don't want to have this console history (like myself), simply disable it from the devtool's configuration options (see on the image) below ...




回答5:


Simply enter clear() in the chrome console to remove all previous text there.




回答6:


I ended up here looking for how to do the same thing in Firefox.

In case anyone else does the same, there is a clearHistory command in the Firefox console which will do just that.

https://developer.mozilla.org/en-US/docs/Tools/Web_Console/The_command_line_interpreter#Helper_commands




回答7:


It can also be fixed by going to the developer tool settings and resetting to defaults.. (this will not reset 'Chrome', only developer tools options)

  • Open Chrome devtools
  • Go to settings (or press Windows ->F1 / OS X -> FN + F1)
  • Reset to the defaults

This way you will lose your developer settings, but for me the only thing that mattered was turning cache off again..




回答8:


These shortcuts Clear Console.

⌘ K or Ctrl L



来源:https://stackoverflow.com/questions/21149156/how-to-remove-all-recent-console-command

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!