Upgrade - confirm navigation away from page
So yesterday, I had one of those moments where I just wanted to kick myself while upgrading CiviCRM. I had fired off the database upgrade (civicrm/upgrade?reset=1) and saw a bunch of notices related to templates which I copied for documentation purposes while the database upgrade continued.
I intended to switch over to a new browser tab and paste the documentation into a document there when before I new it I had migrated away from the upgrade page abandoning the upgrade mid-process. Hoping against hope, I went back and thought perhaps it might be able to pickup where it left off. No such luck. The installation had been interrupted and it was suggested that I restore my backup (which of course I hadn't done because well I never have these sorts of troubles :p) and then try the upgrade process again.
I suspect I am not the first to do this but believe it would be a good idea to add some type of confirmation button on the database upgrade page to save me from myself and make it one step harder to interrupt the upgrade process with a "are you sure you want to continue to interrupt the database upgrade". It just seems a little too easy to interrupt this crucial process.
I was thinking something along the lines of: https://code-maven.com/prevent-leaving-the-page-using-plain-javascript