Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 761
icespace Avatar asked May 13 '11 07:05

icespace


People also ask

Can Chrome extensions use local storage?

Items in local storage are local to the machine the extension is installed on. The browser may restrict the amount of data that an extension can store in the local storage area. For example: In Chrome, an extension is limited to storing 5MB of data using this API unless it has the "unlimitedStorage" permission.

What is HTML5 local storage?

Local storage is part of the HTML5 Web Storage API and it allows you to store data in the browser. Unlike cookies, data stored using local storage isn't sent back to the server. All data stays on the client, and you can currently store from 2MB to 10MB.

What is Chrome storage sync get?

When using storage. sync , the stored data will automatically be synced to any Chrome browser that the user is logged into, provided the user has sync enabled. When Chrome is offline, Chrome stores the data locally. The next time the browser is online, Chrome syncs the data. Even if a user disables syncing, storage.

How do I access extension storage?

Each extension has a "Inspect views: background page" link for this. With the extension's background page open, just go to the developer tools by pressing F12, then go to the Application tab. In the Storage section expand Local Storage. After that, you'll see all your browser's local storage there.


1 Answers

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.

like image 178
Chris McFarland Avatar answered Sep 18 '22 23:09

Chris McFarland