I am using browsers localStorage
to store a value, but while using google chrome, when we refresh the page using window.location.reload()
, lo
You need to use the correct API for Storage:
window.localStorage.setItem('value1', 'true');
What you're doing is setting a property on a variable which won't persist between page loads. Firefox is likely being too smart and recognizing that you want to actually save the value in the browser's local storage store.