Skip to content
← Back to Community
Can i set to autorefresh?
Profile icon
bentalgad

Is it possible to set the "browser" window to auto refresh on changes?

Voters
Profile icon
pkme
Profile icon
LeoXu2
Profile icon
CoolJames1610
Profile icon
bentalgad
Comments
hotnewtop
Profile icon
Vladd007

I figured out a way to do it, just add this into your code:

Make sure to save the file first.

Profile icon
GetonwithIT

Bit late to the conversation but one way around this is to click the 'Open in new tab' icon, put the windows side-by-side and install an auto-refresh browser extension.

Profile icon
PYer

What language are you using? There is no repl it solution, except you could maybe do something with js.

Profile icon
bentalgad

hi @PYer, Thanks.

Mostly HTML, CSS, JS.

Profile icon
PYer

Well, @bentalgad, all I can think of the top of my head would be setting an interval to refresh. This isn't very efficient, but if you are just testing styling and glance at the browser for a second every, say 10 seconds, you could use JS to do

setInterval(function(){ window.location.reload(); }, 10000);
Profile icon
bentalgad

Thanks @PYer,

I guess i will just use codepen :) Thanks anyway!

Profile icon
CoolJames1610

In repl, the changes are automatically saved - if that's what you mean?

Profile icon
bentalgad

Hi @CoolJames1610, Thanks.

I know it saves automatically but doesn't show the changes in the preview part of the window (or the preview window / or the browser ...:) automatically. instead you have the press the refresh button or the "run" button.

Profile icon
CoolJames1610

In your repl, if you click where it says 'saving' or 'saved' maybe that will help you :) @bentalgad

Profile icon
CoolJames1610
Profile icon
bentalgad

maybe i don't understand you but when you clicked that saved/saving it taks you to the file browser. and my question was how can i set the browser to reflect every change in the code live, without clicking anything. (like codepen does for example).

Profile icon
CoolJames1610

Oh I'm not sure. Maybe look online and find something? @bentalgad

Profile icon
CoolJames1610

I've gone onto Codepen and I finally understand what you mean! xD I don't think there is a way for that on repl sorry :( @bentalgad