How to Refresh a Page Automatically Without an Extension
Last updated
You can make a page reload on a timer without an extension in three ways: run a short script in the browser console, add a meta refresh tag if you own the page, or save the script as a bookmarklet. Each works, but each stops when you reload or close the tab, and some sites block them.
These methods are useful when extensions are blocked on a work computer, when you only need a timer once, or when you are building the page yourself. They all work in Chrome and in other Chromium browsers such as Edge, Brave and Opera.
Using the browser console
The obvious script, setInterval(() => location.reload(), 30000), reloads the page exactly once. Reloading throws away every script running on the page, including the timer you just started. The workaround is to show the page inside a full-screen frame and reload only the frame, so your timer survives.
- 1Open the page you want to refresh.
- 2Open DevTools with F12 (Ctrl+Shift+J on Windows, Cmd+Option+J on a Mac) and choose the Console tab.
- 3If Chrome warns about pasting, type “allow pasting” and press Enter.
- 4Paste the code below, set the seconds, and press Enter.
const seconds = 30;
const frame = document.createElement('iframe');
frame.src = location.href;
frame.style.cssText = 'position:fixed;inset:0;width:100%;height:100%;border:0';
document.body.replaceChildren(frame);
setInterval(() => frame.contentWindow.location.reload(), seconds * 1000);Limits: many sites (banks, big retailers, social networks) send a header that forbids being displayed in a frame, so you will see a blank or refused page. Links you click inside the frame stay in the frame. The timer ends when you reload the tab yourself or close it. Only paste code you understand into the console; scammers sometimes ask people to paste code that steals their accounts.
Using a meta refresh tag
If the page is yours, for example a status screen or an internal report, the simplest option is to tell the browser to reload it. Add this line inside the page's <head>:
<meta http-equiv="refresh" content="60">The number is the delay in seconds. Because the tag is part of the page, it is loaded again on every reload, so the page keeps refreshing for as long as it is open. Nobody needs to install or paste anything, which makes it a good fit for wall-mounted displays.
Limits: you can only do this on pages you control. Adding the tag through DevTools on someone else's site triggers at most a single reload, because your edit disappears when the page reloads. For accessibility, avoid very short delays on pages people read, since an unexpected reload can lose their place.
Using a bookmarklet
A bookmarklet is a bookmark that runs a script instead of opening a page. It saves you opening the console each time. This one asks for the number of seconds and then uses the same frame technique as above.
- 1Show the bookmarks bar with Ctrl+Shift+B (Cmd+Shift+B on a Mac).
- 2Right-click the bar and choose “Add page”.
- 3Name it “Auto refresh” and paste the code below into the URL field. Save.
- 4Open any page and click the bookmark. Type the seconds when asked.
javascript:(()=>{const s=Number(prompt('Refresh every how many seconds?','30'));if(!(s>=1))return;const f=document.createElement('iframe');f.src=location.href;f.style.cssText='position:fixed;inset:0;width:100%;height:100%;border:0';document.body.replaceChildren(f);setInterval(()=>f.contentWindow.location.reload(),s*1000);})();Limits: the same as the console method, since it is the same script. Some company browsers disable bookmarklets, and the timer does not survive a manual reload.
Which of the three should I use?
Use the meta refresh tag whenever the page is yours; it is the most reliable and survives reloads. For other people's sites, use the console snippet for a one-off and the bookmarklet if you do it regularly. If the site shows a blank page with either, it blocks framing and only an extension will work.
When is an extension the better choice?
The do-it-yourself methods are fine for a one-off. An extension is easier when:
- The site refuses to load in a frame, so the console and bookmarklet methods show a blank page.
- You want links and buttons on the page to work normally between reloads.
- You refresh several tabs, each on its own timer.
- You want to start and stop with one click instead of pasting code.
For step-by-step extension setup, read how to auto refresh a page in Chrome, and before you pick a very short delay, check how often a page should auto refresh.
Related guides
- How to Auto Refresh a Page in ChromeChrome has no built-in auto refresh. Here are three ways to reload a page automatically: with an extension, from the console, or with a bookmarklet.
- How to Auto Refresh a Page in Edge, Brave and OperaStep-by-step ways to auto refresh a web page in Microsoft Edge, Brave and Opera, including how Chrome Web Store extensions work in each browser.
- How Often Should a Page Auto Refresh? (5, 10, 30 Seconds and More)Pick the right auto refresh interval for prices, tickets, dashboards and job boards, and learn when refreshing every few seconds is too often.
- How to Keep a Website Session Alive with Auto RefreshWhy websites log you out after inactivity, how a timed page refresh keeps your session active, and which interval to use without overdoing it.