The game autosaves periodically, so unless you have some unusual setup (like playing in an incognito window or something), it should be fine to close it.
The save data isn’t shared between the browser version and the desktop version, so you would need to continue wherever you first played the game.