问题
I use Developer Tools Console to run JavaScript commands. It is currently showing history of about 40-50 executed commands accessible using Up Arrow key
.
In the history it is showing repeated commands multiple times and the earlier commands I executed 4-5 days ago have vanished.
Any Idea how to recover/save this history OR expand history to save unlimited commands (like in normal console)?
回答1:
There is no way (as of Firefox 55.0.1) to specify an actually unlimited number of history items to keep. However, you can specify a larger number, up to 2147483647. To do so, go to about:config
. Then, change the preference devtools.webconsole.inputHistoryCount
to the integer value which you desire. The default is 50.
You can verify that there's no way to specify an unlimited size from the source code.
Any Idea how to recover/save this history
There is no way to recover older, forgotten history (see source code linked above). It is forgotten.
The only way I have found to save such code (beyond what is stored in the history) is to copy and paste it into some other location. You could make a legacy add-on which made saving this history easier, but not a WebExtension. In a brief search, I did not find an already existing add-on to do so.
You can find more general information at:
- The command line interpreter
- Web Console
- Browser Console
来源:https://stackoverflow.com/questions/45689706/save-firefox-developer-tools-javascript-command-history