-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbackground.js
More file actions
33 lines (25 loc) · 789 Bytes
/
Copy pathbackground.js
File metadata and controls
33 lines (25 loc) · 789 Bytes
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
chrome.extension.onMessage.addListener(function(request, sender, sendResponse) {
if (request.method == "getExtData") {
var alValues = fromStorage(LOCAL_STORAGE_KEYS.alValues);
var getTypes = function(alValues) {
var nonDefaultTypes = [];
var allTypes = properties(alValues);
allTypes.forEach(function(key) {
if(TYPES.indexOf(key) == -1) {
nonDefaultTypes.push(key);
}
})
return TYPES.concat(nonDefaultTypes);
}
var response = {
alValues: alValues,
encKey: fromStorage(LOCAL_STORAGE_KEYS.encKey),
options: fromStorage(LOCAL_STORAGE_KEYS.options),
types: getTypes(alValues)
};
sendResponse(response);
alValues = null;
response = null;
getTypes = null;
}
});