Suppose you want to automatically refresh your Google Chrome tabs. In that case, you can install a browser extension to get the job done. You can then set custom time intervals to reload your tabs. Many users choose to refresh web pages automatically to remain logged in. But what if you don’t want to install a third-party extension to reload your tabs? Let’s explore the alternatives.
How to Auto-Refresh Chrome Tabs Without Downloading Anything
You can use a special script to instruct Chrome to reload tabs from time to time. You can run the script either as a bookmark or inject it straight into the browser console. You’ll need to always keep the bookmark or browser console tab open for this method to work.
Method 1: Use Tab A to Control Tab B
Open a new tab, and press Ctrl, Shift, and I to open the Chrome console. Then enter the following script:
win1 = window.open("https://www.yourpage.com");
timer1 = setInterval(function(){win1.location.href="https://www.yourpage.com"},10*60*1000);
Basically, win1 is a Javascript variable for Tab B. The setInterval function calls the win1 variable (Tab B) to reload every 10 minutes.
Keep both tabs open for this method to work. If you want to end the auto-refresh script, simply close your tabs. You can use the script above to control multiple tabs. Of course, you’ll need to tweak the script a bit and add multiple win variables, and setInterval functions.
There are two main advantages to using this script: you can reload a web page you have absolutely no control over. The script won’t disappear when the second tab is refreshed.
Method 2: Run the Auto-Refresh Script as a Bookmark
Launch a new tab and paste the script below into your address bar:
javascript:document.getElementsByTagName("body")[0].innerHTML =
"<iframe id=\"testFrame\"
src=\"" + window.location.toString() + "\"
style=\"position: absolute; top:0; left:0; right:0; bottom:0; width:100%; height:100%;\">
<\/iframe>";
reloadTimer = setInterval(
function(){
document.getElementById("testFrame").src=document.getElementById("testFrame").src
},
10000
)
Then save the script as a new bookmark. By entering the script as a bookmark, you force the browser to keep the JavaScript prefix which it would otherwise remove. Basically, you’re replacing the document body with an iframe. The setInterval function is the trigger that reloads the page according to your time interval settings.
Keep in mind that certain web pages may refuse to display any content once they’ve detected you’re using an iframe.
Method 3: Run the Auto-Refresh Script in the DevTools 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. Alternatively, you can also click on More options (the three vertical dots), select More tools, and then click on Developer tools.
Then click on the Console tab and enter the script below:
document.getElementsByTagName("body")[0].innerHTML= `<iframe id="testFrame" src=""+window.location.toString()+"" style="position: absolute; top:0; left:0; right:0; bottom:0; width:100%; height:100%;"> </iframe>`; setInterval(()=>{document.getElementById("testFrame").src=document.getElementById("testFrame").src},10000);
Well, suppose you don’t really feel comfortable running these scripts. In that case, you can use a browser extension to automatically reload your tabs from time to time.
Conclusion
To automatically refresh Chrome tabs, you can inject a unique script directly into the browser console. Alternatively, you can save the script as a bookmark. If these methods don’t work, you can use a browser extension that automatically reloads your tabs.
Did you manage to run the scripts above? Let us know in the comments below.
Sean says
How can we do this for igel OS running chromium?
josh says
can you add a line that stops the auto refresh when the page that keeps on refreshing changes? for example:
page will auto refresh to google.com.. i have a script that when a button appears it will click that button and move to yahoo.com. I want the auto refresh to stop when its at yahoo.com
didier says
could this BE more complicated?
wht the fark doesnt Ctrl-R work anymore
2022 all teh tech in the world but chrome keeps showing my cached page from 3 years ago.
James says
Doesn’t work for me, not any f the 3 solutions :(
Especially the first one. I set it for every second, and I don’t see any realoading. mouse cursor or tab aniamtion. Is it normal or am I missing something ?
Lynn Duerksen says
I have used method 2 successfully in the past. However, the site is now detecting the iframe and it no longer works.
Do you have something that will work without iframes?
jimmy says
Thank you for providing this info.
HOWEVER, I don’t code in HTML, so I would appreciate if you would provide step-by-step instructions for inserting this code into the tab code. Also, if you can convert this to a bookmarklet, that would be super.
RemmieV says
It would be nice to load one of those solutions (preferred method 2) through a self created extension, if that’s even possible. I’m trying to figure out how to create an extension. Why? Cause 1) I don’t want to use a third-party extension 2) the user shouldn’t have to do all manual actions to auto-refresh open a page, it should go automatically. Any ideas?
drax says
hello may i request additional script like it will be stop if it finds a new content on the tab thanks.
Alexandre says
AMAZING!