Search code examples
javascriptgoogle-chromeconsolerefresh

Reload page without reloading console data


I am trying to run some javascript in google chrome console. In it somewhere between I need to perform

location.reload();

So that page gets refreshed, but with it whole console data (functions which I am defining in colsole) gets destroyed. So my question is as follow: Is there any way to refresh a webpage without reloading console window?


Solution

  • No. The console is a property of the window object, which is what you're reloading.

    You can overrule that at the browser level by keeping the console log data on reload, but it won't be part of the new window's scope: Chrome: Developer Tools > Console > Preserve log upon navigation