The game already does Auto Saves every five seconds.
If you had the tab open and still lost progress, that is weird.
What browser are you using?
What auto clicker are you using and with which settings, could it be that it causes a crash?
How exactly does it crash? Are there any errors in the browser developer console? (Ctrl + Shift + I on Chrome to open after clicking outside the game window.)