AGanz
AGanz

Reputation: 35

Permanent storage for Chrome Extension

I'm looking for the best client side storage for my chrome extension. Local storage isn't suitable as it can be erased by the user deleting their cookies (which is a common occurrence).

What storage can I use for permanent storage in a Chrome Extension (excluding WebSQL - deprecated)?

Upvotes: 1

Views: 2221

Answers (1)

Stack Overflown
Stack Overflown

Reputation: 702

Try the Chrome storage API.

This API has been optimized to meet the specific storage needs of extensions. It provides the same storage capabilities as the localStorage API with the following key differences:

  • User data can be automatically synced with Chrome sync (using storage.sync).
  • Your extension's content scripts can directly access user data without the need for a background page.
  • A user's extension settings can be persisted even when using split incognito behavior.
  • It's asynchronous with bulk read and write operations, and therefore faster than the blocking and serial localStorage API.
  • User data can be stored as objects (the localStorage API stores data in strings).
  • Enterprise policies configured by the administrator for the extension can be read (using storage.managed with a schema).

Upvotes: 1

Related Questions