Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable Chrome Auto Reload on Time Out Error

I'm a web developer, and often run scripts to fix things that might time out due to server or browser settings. In the past, Chrome would just spin and spin as long as it takes until the script was done - even if it takes an hour, but they changed things and now, it imposes its own cutoff time is the server doesn't respond fast enough while the server continues to execute the script.

Now, this is annoying, it forces me to log events to a file, rather than just dump to the screen, but the worst part is Chrome thinks it is a great idea to try reconnecting to the URL after it times out. That then starts to execute the same script which probably is already running again.

The issue here is that I often create scripts to run ONCE and never again, and if the script is run more than once, it could completely destroy things.

Say I create a script to remove the first 4 characters from each field in a 1 million row database. Running the script via Chrome would eventually time out and then it would run the script again several times without letting you know. Suddenly, the data that was already reduced is being reduced again, destroying the data.

This is a serious concern that was never an issue before because Chrome wouldn't automatically try to reload a page that failed to load. So, I'm looking for a way to disable this new feature and stop Chrome from automatically reloading on a failed page load. It displays an error page saying "Click here to reload", but it completely ignores the user and decides to reload whether you click it or not.

I just ran a script to copy files from an EC2 instance to an S3 bucket as part of some cleanup, but I see from the logs that it actually ran 4 times before I closed the tab - even though I never asked it to reload. That meant it copied these same files 4 times. Fortunately, in this case, it just wasted S3 access, since it overwrote the existing files.

Yes, I realize that there are many ways of preventing the script from running more than once, from flock to renaming the file immediately after executing it. The issue is speed. These fix scripts are not intended to be full blown applications complete with all the bells and whistles, they are meant to be a fast way to apply a fix. I would rather make a change in Chrome to disable the new way it works so that I can continue to work as I have for over 10 years.

This is referring to an auto reload, and I'm not calling it a "refresh" because the page never loaded in the first place. This has nothing to do with the millions of questions regarding refreshes, and that is all I get when trying to search this problem out.

like image 521
Exit Avatar asked Sep 15 '15 00:09

Exit


People also ask

How do I stop Chrome from auto-refreshing?

Disable Auto-Refresh in Google ChromeGo to Details and click on Extension options. Tick the option with Disable Meta Refresh elements in pages and click on Close. Additionally one can disable the automatic tab discarding to stop the tabs from auto-refreshing. Go to Chrome://flags in the URL.

Why does Google Chrome keep refreshing itself?

By default, if it's using a lot of memory, Chrome purges the contents of some background tabs from RAM to conserve system resources. When you click back onto those tabs, the browser has to reload them because they have been erased from memory.

How do I stop my browser from auto-refreshing?

Click the Start button, type “internet options” and select Internet Options in the search results. In the Internet Properties window, click “Custom tab -> Custom level,” then in the Security Settings window, scroll down until you find “Allow META REFRESH.” Disable this option and click OK.

How do I stop Chrome from automatically refreshing tabs Android?

To prevent this, switch the toggle to X, and Chrome won't refresh specific tabs that you don't want to be refreshed. Additionally, you can copy and paste “chrome://flags/” into Chrome's address bar to open the flags page. On this page, you should search for “automatic tab discarding”.


1 Answers

Probably this can resolve the issue:

  1. go to chrome://flags/
  2. set to Disabled flag Enable Offline Auto-Reload Mode (or Offline Auto-Reload Mode)
  3. set to Disabled flag Only Auto-Reload Visible Tabs
  4. Relaunch browser

Now I have page with error ERR_CONNECTION_RESET that does not reload itself automatically anymore

like image 142
Kirill Oficerov Avatar answered Sep 30 '22 17:09

Kirill Oficerov