Do popup.html and background.html share the same local storage?
If I understand correctly, popup.html and background.html share the same lo开发者_开发百科cal storage since they run in the same sandbox. And content script does not share the same one since it run in another sandbox. Right?
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.
精彩评论