I would like to be able to make a script that runs on my computer, so that a web page (Let's say I have a www.google.es and I want to refresh it every 10 seconds) is refreshed (same function as doing F5) continuously (every 10 seconds let's say ).
The question refers only to refreshing an open web in my browser. Not to a website that I create and that I program in HTML.
I'm pretty new to all of this.
What I have tried is this in a file with extension .PS1 (To begin with, I don't know if this is the correct extension or should I use another extension). I am also not very clear where I have to indicate the address of the web that I want to update
//Función actualizar
<script type="text/javascript">
function actualizar(){location.reload(true);}
//Función para actualizar cada 5 segundos(5000 milisegundos)
setInterval("actualizar()",5000);
</script>
Thank you so much
The code is correct, with it you would be able to refresh the page. About your question I tell you 2 things:
In order for the method to execute, you must call it.
That code will only work in the document that you have inserted it. In other words, if you want to refresh an external page outside your control, you won't be able to with the code, because you can't install it in its source code, and even if you manage to execute it in the browser console, when you restart it, it will stop working.
If you only want to refresh the page, I recommend that you enable a browser extension, such as Easy Auto Refresh in chrome.