-
Notifications
You must be signed in to change notification settings - Fork 11
/
settings.js
47 lines (38 loc) · 820 Bytes
/
settings.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/**
* @file
* @since 2021-02-03
* @author https://github.com/andre-st
*
* Note:
* - doc-comments conventions: http://usejsdoc.org/
* - members prefixed with an underscore are private members (_function, _attribute)
*
*/
"use strict";
/**
* @namespace
* @description Chrome Extension Settings utils library
*
*
* Note:
* chrome.storage.local no limit
* versus
* chrome.storage.sync.QUOTA_BYTES_PER_ITEM = 8192
*
*
*/
const nsSettings =
{
addChangeListener: function( theCallback )
{
chrome.storage.onChanged.addListener( theCallback ); // (changes,areaName)
},
get: function( theKeys, theCallback )
{
chrome.storage.local.get( theKeys, theCallback );
},
set: function( theStoreObj, theCallback )
{
chrome.storage.local.set( theStoreObj, theCallback );
}
}