If I understand correctly, popup.html and background.html share the same local storage since they run in the same sandbox. And content script does not share the same one since it run in another sandbox. Right?
Asked
Active
Viewed 2,792 times
6
-
Also see http://stackoverflow.com/questions/3937000/chrome-extension-accessing-localstorage-in-content-script for other options. – studgeek Jun 18 '14 at 00:49
1 Answers
10
Correct. Calling localStorage
from a Chrome extension's Background page, Browser Action page or Page Action page uses the extension's local storage.
Content scripts only run on normal web pages and generally can't access Chrome's extension API, so their local storage access would be limited to the specific website's local storage.

Chris McFarland
- 6,059
- 5
- 43
- 63
-
Actually, I'm pretty sure a content script can't access a page's `localStorage`. – mattsven May 13 '11 at 17:39
-
2Thank you guys. Correct, content script can't access local storage of extension. Tested. – icespace May 16 '11 at 07:19