Orteil is the creator of Cookie Clicker and other small browser games and generators.
HN commenters point to Cookie Clicker as the classic of the incremental game genre whenever a similar game is posted.
Here's an example: http://orteil.dashnet.org/cookieclicker/
Opening another tab creates a new bakery, not a view into the same bakery. (This only works if you haven't played before or clear your cookies.)
Edit:
If you really want to keep the same functionality then you would need to bring server communication into the mix. It's possible to either run the simulation server-side, or at least communicate the state between tabs using a server.
If you send an email in one Gmail window and it shows up in the other window, then I would guess it receives a message from the server to update.
Surprised no one has mentioned Cookie Clicker yet, which I think was what inspired notch to write that game: http://orteil.dashnet.org/cookieclicker/
Notch's game was written in Dart and the source code is simple and elegant:
http://ludumdare.com/compo/ludum-dare-29/?action=preview&uid=398
With due respect that's completely wrong. Clicker games have been a thing long before microtransactions were around and popular. I remember sinking an hour or two into cookie clicker: http://orteil.dashnet.org/cookieclicker/
It's very Cookie Clicker like https://orteil.dashnet.org/cookieclicker/ so I was expecting to see an upgrade to buy an autoclicker. Reading that bots are not allowed, made it clear that it was a very different game.
While not as suitable for actually playing tile based RPGs, I am partial to http://orteil.dashnet.org/experiments/dungeongenerator/ for the nice visual design of the generated dungeons.
Cookie Clicker: http://orteil.dashnet.org/cookieclicker/
This game is all client-side so it's easy to cheat. The cool thing is you actually get achievements for cheating!