Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 450
vishtree Avatar asked Jan 25 '13 18:01

vishtree


People also ask

How do you keep value after page reloading?

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.

How do you refresh a page in console?

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.

How do you refresh the page without reload in react?

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.

Is reloading a page the same as refreshing?

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.


1 Answers

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

like image 169
AlienWebguy Avatar answered Sep 21 '22 23:09

AlienWebguy