JavaScript – How to temporary store value-key pair until browser tab is closed