Do popup.html and background.html share the same local storage?

南楼画角 提交于 2019-12-22 05:42:12

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/5988612/do-popup-html-and-background-html-share-the-same-local-storage

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!