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?
The easiest way to reload the current page without losing form data, use WebStorage where you have -persistent storage (localStorage) or session-based (sessionStorage) which remains in memory until your web browser is closed. window. onload = function() { var name = localStorage.
First, load the page you want to refresh. To run the auto-refresh tab script in the DevTools console, you first need to open the console. On Windows, press the Shift, Ctrl, and I keys. On macOS, press Option, Command, and J.
reload(false); This method takes an optional parameter which by default is set to false. If set to true, the browser will do a complete page refresh from the server and not from the cached version of the page.
AFAIK refresh is when the page (eg. mete refresh) instructs the browser to reload the page, and reload (eg. the browser button) is when the user decides to have the browser refresh the page.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With