Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Global value for localStorage as oppossed to per domain

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 ?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

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/

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading