when storage is changed javascript google chrome code example
Example: listen to localstorage changes
window.addEventListener('storage', () => {
// When local storage changes, dump the list to
// the console.
console.log(JSON.parse(window.localStorage.getItem('sampleList')));
});