What happens when we use localStorage in a Chrome extension ?
localStorage.setItem('foo', 'bar');
foo is stored in its respective localStorage for every website we visit ?
So 10 different website visits mean 10 versions of foo ?
Is there a way to store foo globally ?
>Solution :
If you use chrome.storage.local, you can store data "globally" for the entire extension. But only the extension will have access to it, websites will not.
https://developer.chrome.com/docs/extensions/reference/storage/