Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make Google Chrome JavaScript console persistent?

Since I'm building a dynamic site, I need to track the changes between pages, ie. Ajax calls, POST, GET stuff and similar stuff.

I'm looking for the same functionality like in Firebug (where you can enable "persistent" and the console is not cleared every time you reload a page or submit a form.

So, my questions is: is there a way to make Google Chrome JavaScript console persistent? (And if yes, how?)

Update: Copying the answer here, if anyone's still looking for this, Chrome 14+ has a setting in Developer Tools > Settings labelled "Console: Preserve log on navigation".

Update 2: the latest versions of Chrome (33+) have this option by right-clicking in the console.

Update 3 (late 2017): The latest versions of Chrome (60+) have this option by opening the console, clicking the gear in the top right corner and selecting "preserve log"

like image 872
Zlatko Avatar asked Mar 16 '11 15:03

Zlatko


People also ask

How do you preserve console logs?

Chrome console log Click the 3 dots, at the top-right, to open the overflow menu. Choose 'More tools' > 'Developer tools' to bring up the console. Select the 'Console'' tab and make sure the option 'Preserve log' is checked. Reproduce the issue.

How do I stop my console from clearing?

You need to open the developer tools with Ctrl + Alt (or Cmd + Option) + I. As of Chrome 70 (and maybe before that) the settings cog is at the top right of the console window. Click it, and then click 'Preserve log'.

Can I write JavaScript in Chrome console?

You don't necessarily need to have an HTML page. Open Chrome, press Ctrl+Shift+j and it opens the JavaScript console where you can write and test your code.


5 Answers

If anyone's still looking for this, I'm on Chrome 15.0.874.58 beta-m and I have a checkbox in Developer Tools > Settings labelled "Console: Preserve log on navigation". Does the job nicely.

image of setting

like image 177
Nick Cox Avatar answered Oct 02 '22 02:10

Nick Cox


enter image description here

at Version 67.0.3396.87 (Official Build) (64-bit)

like image 39
Simon Avatar answered Oct 02 '22 02:10

Simon


Unfortunately, Chrome doesn't support that functionality yet, although there was talk in December 2010 about adding in the next major release...

This answer is no longer valid

like image 45
BenM Avatar answered Oct 02 '22 03:10

BenM


As of Chrome Version 73.0.3683.86 (Official Build) (64-bit):

  1. Click the ellipsis in top right of Developer Tools top ellipsis
  2. Navigate to Settings > Preferences > Console
  3. Check Preserve log upon navigation

console options

like image 36
Thomas Rokicki Avatar answered Oct 02 '22 02:10

Thomas Rokicki


Try this to enable console on popups

enter image description here

like image 43
Kris Avatar answered Oct 02 '22 03:10

Kris