localforage-webextensionstorage-driver
v3.0.0
Published
LocalForage storage driver for WebExtension storage APIs
Downloads
1,496
Readme
LocalForage WebExtension chrome.storage driver
This project adds a webextension driver to localForage
Usage
Using a module bundler:
import localforage from 'localforage';
import syncDriver from 'localforage-webextensionstorage-driver/sync';
localforage
.defineDriver(syncDriver)
.then(() => localforage.setDriver('webExtensionSyncStorage'));
// When this promise resolves, a new driver should be set
Using plain javascript:
This project was not originally intended to be used without a module bundler like webpack, so the result will be a larger file if you do it this way. However, if you wish to do so, you can find a browser compatible file on the releases page.
There is an example of how use this here.
Install
$ npm install --save localforage-webextensionstorage-driver
API
|Import Path |Driver Name (setDriver
)|Description |
|--------------------------------------------|-------------------------|---------------------------------|
|localforage-webextensionstorage-driver/local|webExtensionLocalStorage |chrome/browser.local storage area|
|localforage-webextensionstorage-driver/sync |webExtensionSyncStorage |chrome/browser.sync storage area |