Sélectionner une page

Vous pouvez utiliser la flèche vers le haut ou taper le début d'une commande précédente pour rechercher votre historique de commandes dans DevTools, mais si tu ne te souviens pas de la commande et c'est loin dans ton histoire, vous pouvez utiliser cette méthode pour voir tout l'historique de votre console:

  1. Dans DevTools, Undock into separate window (search for it with Ctrl+Shift+P)
  2. Ctrl+Shift+J to DevTool your DevTools (inceptioooooon)
  3. Go to the Application tab -> Local Storage -> devtools://devtools
  4. Double-click or Edit the value of consoleHistory, and copy it
  5. To unescape the backlashed newlines and quotes, paste it into a variable and print it to console, where a ‘Copybutton will appear:
    history = ["Your console history here"]
    console.log( history.join( '\n\n------\n\n' ) )
  6. Or inject it into a new tab:
    var win = window.open(); 
    win.document.body.innerHTML = "<pre>"+ l'histoire +"</pre>";

Bonus tip: vous pouvez Ctrl + Shift + P Effacer l'historique de la console.