If I use localStorage in a Google Chrome extension, is it the storage of the current webpage, or is it the storage of the extension?
Alternatively, how can I reach each localStorage independently?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Depends on where you use it. If you use it on the
backgroundoroptionspage, it is of the extension, and it is shared. If it is from a content script, it is on the specific page. You can’t reach thelocalStorageof each page at will, so if you want to do that, you should send a request to the background and store it in the extension’s storage.Note that if you’re using the extension’s storage, you may want to use
chrome.storageinstead.