21

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.

4
  • Are you using the GET request ?
    – Qingfeng
    Commented Sep 16, 2015 at 1:20
  • Nope. These scripts usually have no query variables (POST or GET), but that isn't relevant. This is purely a question about how to disable a newer feature in Chrome.
    – Exit
    Commented Sep 16, 2015 at 11:51
  • I mean: chrome won't reload a POST request, will he? Maybe you should try POST, just saying.
    – Qingfeng
    Commented Sep 16, 2015 at 11:57
  • In this case, you may be right, because Chrome displays a different screen on a POST refresh, but I'm not sure how that works if the page never loads in the first place. That being said, executing a POST request would be burdensome as I'd have to create a form before running the script rather than just running the script. This is all about getting Chrome to behave like it did months ago.
    – Exit
    Commented Sep 16, 2015 at 12:23

2 Answers 2

17

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

5
  • 1
    YES. Exactly what I was looking for. Thanks much.
    – Exit
    Commented Sep 28, 2015 at 20:41
  • For those of us that are lazy: chrome://flags/#enable-offline-auto-reload & chrome://flags/#enable-offline-auto-reload-visible-only Commented Jun 13, 2017 at 3:19
  • "Pages that fail to load while the browser is offline will be auto-reloaded when the browser is online again" - I'm not sure that it will work when browser is online and server is taking a long time to respond. In fact, I'm now trying to debug a PHP script an Chrome keeps reloading the page when it reaches the timeout Commented Dec 17, 2018 at 15:18
  • 11
    This flag is no longer available, and damn Chrome keeps doing this to me. Same situation as OP!
    – linus
    Commented Apr 13, 2020 at 17:35
  • 3
    Still going on half a year later, with no option to disable it. Every developer doing proper debugging must be so annoyed!
    – patrick
    Commented Aug 13, 2020 at 22:49
0

This is the solution I use:

Get an older version of Chrome

SlimJet makes their own browser, but they also have links to older copies of Chrome. I tried multiple 64-bit versions. Not all of them have the flag options. Some editions wanted to be installed and I didn't want that. I preferred having the older Chrome just exist in a folder that I'd launch when needed (ie: portable format). The one that worked the best for me was this one: Chrome (64-bit) version 60.0.3112.78. If you'd like to experiment with other versions available from them, the link to all of them is here.

Right-click on chrome64_60.0.3112.78 and unzip it with 7-zip. You'll get a Checksum error - ignore that. Now extract the chrome.7z inside of that. Inside of the Chrome-bin folder is chrome.exe.

Close any modern versions of Chrome and then run the older chrome.exe. If the modern browser opens up, that means it was not fully closed. Close the modern browser again, then go to Task Manager/Details and make sure all copies of Chrome.exe are end-tasked, then try it again.

You now have a working older-version of Chrome.

Set Chrome flags

As mentioned by Kirill Oficerov and Brad Christie, these are the flags you'll need to set. They exist in this older Version 60 of Chrome.

chrome://flags/

  • Set Offline Auto-Reload Mode = Disabled
  • Set Only Auto-Reload Visible Tabs = Disabled

Configured Chrome Flags

Make Chrome run a single thread

Without this, Chrome will run multiple threads, which can make debugging tracing hard. To have it run a single thread, while in Chrome, open up the Developer tools (Control-Shift-I). enter image description here

Once that opens, I prefer to also disable the cache. enter image description here

Now naviate to your URI/URL. Now Chrome should sit there patiently, waiting for you to trace through your code before it presents the page.

Not the answer you're looking for? Browse other questions tagged or ask your own question.