added a js file for managing browser state