abhijithvijayan / web-extension-starter

🖥🔋Web Extension starter to build "Write Once Run on Any Browser" extension
MIT License
2.01k stars 171 forks source link

How to access browser local storage API? #92

Closed itsfadnis closed 2 years ago

itsfadnis commented 2 years ago

Hi. This plugin is meant for cross browser support, so is there a standardised API to access local storage?

In chrome we access it via the chrome.storage.local.get/set methods. However what is the right way to access it in a browser agnostic way, if any?

abhijithvijayan commented 2 years ago

yes, please refer https://github.com/thedevs-network/kutt-extension/blob/master/source/util/settings.ts for examples

I also wrote a class wrapper around it which you can take a look at https://github.com/abhijithvijayan/Resumey.Pro-Downloader/blob/main/source/utils/storage.ts