These localStorage values should not get out of sync between tabs. However, in Safari 14.1 they do, and there's no workaround. Even page reloads continue to use stale values.

localStorage 'foo' is:

localStorage 'bar' is: