@vacantthinker/firefox-addon-framework-easy 2026.604.1641 → 2026.604.1745
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -3
- package/package.json +1 -1
- package/src/BaseORM.js +4 -8
- package/src/DomainORM.js +3 -4
- package/src/browserDownload.js +1 -1
- package/src/browserNotification.js +8 -13
- package/src/browserRuntime.js +1 -19
- package/src/browserRuntimeOnMessageCommon.js +1 -1
- package/src/browserTab.js +13 -2
- package/src/generate.js +4 -5
- package/src/opStorage.js +14 -37
- package/src/opTab.js +2 -11
- package/src/serviceCommon.js +1 -1
- package/src/serviceFetch.js +18 -37
- package/src/serviceGet.js +0 -3
- package/src/serviceOpJavascript.js +0 -3
- package/src/serviceUpdateTabStyle.js +2 -6
- package/src/serviceUserSettings.js +2 -2
package/README.md
CHANGED
|
@@ -34,7 +34,7 @@ export async function browserDownloadByDownlink(
|
|
|
34
34
|
```javascript
|
|
35
35
|
export async function browserNotificationCreate(
|
|
36
36
|
content,
|
|
37
|
-
title = browserRuntimeManifestName()
|
|
37
|
+
title = browserRuntimeManifestName(),
|
|
38
38
|
) { }
|
|
39
39
|
|
|
40
40
|
```
|
|
@@ -44,7 +44,7 @@ export async function browserNotificationCreate(
|
|
|
44
44
|
export function browserRuntimeReload() { }
|
|
45
45
|
|
|
46
46
|
export async function browserRuntimeSetUninstallURL(
|
|
47
|
-
url = '
|
|
47
|
+
url = '',
|
|
48
48
|
) { }
|
|
49
49
|
|
|
50
50
|
export function browserRuntimeOnUpdateAvailable(doWhat = null) { }
|
|
@@ -69,6 +69,8 @@ export function browserRuntimeOnMessageCommon() { }
|
|
|
69
69
|
```javascript
|
|
70
70
|
export async function browserTabSendMessage(tabId, message) { }
|
|
71
71
|
|
|
72
|
+
export function browserTabWaitReloadThenSendMessageToContentJs(message) { }
|
|
73
|
+
|
|
72
74
|
export async function browserTabCreateToDownload(message) { }
|
|
73
75
|
|
|
74
76
|
export async function browserTabCreateNearSendMessageToContentJs(message) { }
|
|
@@ -163,7 +165,6 @@ export async function serviceDownloadByDownlink(message) { }
|
|
|
163
165
|
export async function servicePostJson(
|
|
164
166
|
serverUrl,
|
|
165
167
|
message,
|
|
166
|
-
handleError,
|
|
167
168
|
) { }
|
|
168
169
|
|
|
169
170
|
export async function serviceSendDataToLocalAria2(message) { }
|
package/package.json
CHANGED
package/src/BaseORM.js
CHANGED
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
stoOpCheck,
|
|
3
|
-
stoOpGet,
|
|
4
|
-
stoOpRem,
|
|
5
|
-
stoOpSet,
|
|
6
|
-
} from './opStorage.js';
|
|
1
|
+
import {stoOpCheck, stoOpGet, stoOpRem, stoOpSet} from './opStorage.js';
|
|
7
2
|
|
|
8
3
|
/**
|
|
9
4
|
* Abstract base class BaseORM (similar to Java's Abstract Class).
|
|
@@ -23,10 +18,11 @@ export class BaseORM {
|
|
|
23
18
|
*/
|
|
24
19
|
constructor(prefix, id, defaultValue = {}) {
|
|
25
20
|
if (new.target === BaseORM) {
|
|
26
|
-
throw new TypeError(
|
|
21
|
+
throw new TypeError(
|
|
22
|
+
'Cannot construct BaseORM instances directly (Abstract Class).');
|
|
27
23
|
}
|
|
28
24
|
if (!prefix || !id) {
|
|
29
|
-
throw new Error(
|
|
25
|
+
throw new Error('Both prefix and id must be specified.');
|
|
30
26
|
}
|
|
31
27
|
|
|
32
28
|
// Save the raw id to the private field
|
package/src/DomainORM.js
CHANGED
|
@@ -2,11 +2,10 @@ import {BaseORM} from './BaseORM.js';
|
|
|
2
2
|
|
|
3
3
|
export class DomainORM extends BaseORM {
|
|
4
4
|
constructor(domain) {
|
|
5
|
-
super(`domainKey`, domain, {
|
|
6
|
-
|
|
7
|
-
});
|
|
5
|
+
super(`domainKey`, domain, {});
|
|
8
6
|
}
|
|
9
|
-
|
|
7
|
+
|
|
8
|
+
logKey() {
|
|
10
9
|
console.info(this.id); // domainKey 123sdfsdf
|
|
11
10
|
}
|
|
12
11
|
}
|
package/src/browserDownload.js
CHANGED
|
@@ -8,20 +8,15 @@ import {browserRuntimeManifestName} from './browserRuntime.js';
|
|
|
8
8
|
*/
|
|
9
9
|
export async function browserNotificationCreate(
|
|
10
10
|
content,
|
|
11
|
-
title = browserRuntimeManifestName()
|
|
11
|
+
title = browserRuntimeManifestName(),
|
|
12
12
|
) {
|
|
13
13
|
|
|
14
14
|
const tag = 'browserNotificationCreate';
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
});
|
|
23
|
-
return notificationId;
|
|
24
|
-
} catch (e) {
|
|
25
|
-
console.error(tag, e);
|
|
26
|
-
}
|
|
15
|
+
let notificationId = `${tag}cake-noti`;
|
|
16
|
+
await browser.notifications.create(notificationId, {
|
|
17
|
+
type: 'basic',
|
|
18
|
+
title,
|
|
19
|
+
message: `${content}`,
|
|
20
|
+
});
|
|
21
|
+
return notificationId;
|
|
27
22
|
}
|
package/src/browserRuntime.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import {tabOpCreateActiveFalse} from './opTab.js';
|
|
2
|
-
import {browserNotificationCreate} from './browserNotification.js';
|
|
3
|
-
|
|
4
1
|
export function browserRuntimeReload() {
|
|
5
2
|
browser.runtime.reload();
|
|
6
3
|
}
|
|
@@ -10,7 +7,7 @@ export function browserRuntimeReload() {
|
|
|
10
7
|
* @param url{string}
|
|
11
8
|
*/
|
|
12
9
|
export async function browserRuntimeSetUninstallURL(
|
|
13
|
-
url = '
|
|
10
|
+
url = '',
|
|
14
11
|
) {
|
|
15
12
|
await browser.runtime.setUninstallURL(url);
|
|
16
13
|
}
|
|
@@ -24,21 +21,6 @@ export function browserRuntimeOnUpdateAvailable(doWhat = null) {
|
|
|
24
21
|
if (doWhat) {
|
|
25
22
|
await doWhat(details);
|
|
26
23
|
}
|
|
27
|
-
else {
|
|
28
|
-
try {
|
|
29
|
-
let id = await browserNotificationCreate(
|
|
30
|
-
'There is a new version!',
|
|
31
|
-
);
|
|
32
|
-
browser.notifications.onClicked.addListener(async (notificationId) => {
|
|
33
|
-
if (notificationId === id) {
|
|
34
|
-
let url = 'https://addons.mozilla.org/en-US/firefox/user/17783213/';
|
|
35
|
-
await tabOpCreateActiveFalse({url});
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
} catch (e) {
|
|
39
|
-
console.error(e);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
24
|
});
|
|
43
25
|
}
|
|
44
26
|
|
|
@@ -25,7 +25,7 @@ export function browserRuntimeOnMessageCommon() {
|
|
|
25
25
|
console.log('act', act, 'message', message);
|
|
26
26
|
}
|
|
27
27
|
else if (act === 'actRemoveTab') {
|
|
28
|
-
tabOpRemove(message.tabId)
|
|
28
|
+
tabOpRemove(message.tabId);
|
|
29
29
|
}
|
|
30
30
|
else if (act === 'actDownloadFile') {
|
|
31
31
|
serviceDownloadByDownlink(message);
|
package/src/browserTab.js
CHANGED
|
@@ -7,6 +7,18 @@ export async function browserTabSendMessage(tabId, message) {
|
|
|
7
7
|
await browser.tabs.sendMessage(tabId, message);
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
+
export function browserTabWaitReloadThenSendMessageToContentJs(message) {
|
|
11
|
+
let tabId = message.tabId;
|
|
12
|
+
browser.tabs.onUpdated.addListener(
|
|
13
|
+
async function lis(tabId, changeInfo) {
|
|
14
|
+
if (changeInfo.status === 'complete') {
|
|
15
|
+
browser.tabs.onUpdated.removeListener(lis);
|
|
16
|
+
await browserTabSendMessage(tabId, message);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
, {tabId, properties: ['status']});
|
|
20
|
+
}
|
|
21
|
+
|
|
10
22
|
/**
|
|
11
23
|
* must has, url
|
|
12
24
|
* @param message{{
|
|
@@ -33,13 +45,12 @@ export async function browserTabCreateToDownload(message) {
|
|
|
33
45
|
if (changeInfo.status === 'complete') {
|
|
34
46
|
browser.tabs.onUpdated.removeListener(lis);
|
|
35
47
|
// todo code here
|
|
36
|
-
await tabOpRemove(tabId)
|
|
48
|
+
await tabOpRemove(tabId);
|
|
37
49
|
}
|
|
38
50
|
}
|
|
39
51
|
, {tabId, properties: ['status']});
|
|
40
52
|
}
|
|
41
53
|
|
|
42
|
-
|
|
43
54
|
/**
|
|
44
55
|
* must has, tabId, url
|
|
45
56
|
* @param message{{
|
package/src/generate.js
CHANGED
|
@@ -29,6 +29,10 @@ export function generateHtmlByUserSettings(
|
|
|
29
29
|
|
|
30
30
|
// --- CONDITION 1: CHECKBOX & RADIO ---
|
|
31
31
|
if (type === 'checkbox' || type === 'radio') {
|
|
32
|
+
/**
|
|
33
|
+
*
|
|
34
|
+
* @type {string[]}
|
|
35
|
+
*/
|
|
32
36
|
const options = storageValue.options || [];
|
|
33
37
|
|
|
34
38
|
options.map((option) => {
|
|
@@ -63,8 +67,6 @@ export function generateHtmlByUserSettings(
|
|
|
63
67
|
}
|
|
64
68
|
|
|
65
69
|
const valueNew = Array.from(set);
|
|
66
|
-
console.info(
|
|
67
|
-
`k=${storageKey} option=${option} eleInput.checked=${eleInput.checked} valueNew=${valueNew}`);
|
|
68
70
|
await stoOpSet(storageKey, valueNew);
|
|
69
71
|
|
|
70
72
|
// Dynamic visibility update
|
|
@@ -86,7 +88,6 @@ export function generateHtmlByUserSettings(
|
|
|
86
88
|
|
|
87
89
|
eleLabel.onclick = function() {
|
|
88
90
|
stoOpSet(storageKey, option).then(() => {
|
|
89
|
-
console.info(`k=${storageKey} option=${option}`);
|
|
90
91
|
if (typeof radioItemClickCallback === 'function') {
|
|
91
92
|
radioItemClickCallback(storageKey, option);
|
|
92
93
|
}
|
|
@@ -120,7 +121,6 @@ export function generateHtmlByUserSettings(
|
|
|
120
121
|
eleButton.addEventListener('click', async () => {
|
|
121
122
|
currentStatus = !currentStatus; // Toggle state
|
|
122
123
|
eleButton.textContent = String(currentStatus);
|
|
123
|
-
console.info(`k=${storageKey} toggled to=${currentStatus}`);
|
|
124
124
|
await stoOpSet(storageKey, currentStatus);
|
|
125
125
|
|
|
126
126
|
// Dynamic visibility update
|
|
@@ -152,7 +152,6 @@ export function generateHtmlByUserSettings(
|
|
|
152
152
|
const rawValue = eleInput.value;
|
|
153
153
|
const finalizedValue = type === 'number' ? Number(rawValue) : rawValue;
|
|
154
154
|
|
|
155
|
-
console.info(`k=${storageKey} value changed to=${finalizedValue}`);
|
|
156
155
|
await stoOpSet(storageKey, finalizedValue);
|
|
157
156
|
|
|
158
157
|
// Dynamic visibility update
|
package/src/opStorage.js
CHANGED
|
@@ -4,16 +4,11 @@
|
|
|
4
4
|
* @returns {Promise<boolean>}
|
|
5
5
|
*/
|
|
6
6
|
export async function stoOpCheck(k) {
|
|
7
|
-
|
|
8
|
-
let key = k.toString();
|
|
7
|
+
let key = k.toString();
|
|
9
8
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return b;
|
|
14
|
-
} catch (e) {
|
|
15
|
-
return false;
|
|
16
|
-
}
|
|
9
|
+
let objGet = await browser.storage.local.get(key);
|
|
10
|
+
let b = objGet.hasOwnProperty(key);
|
|
11
|
+
return b;
|
|
17
12
|
}
|
|
18
13
|
|
|
19
14
|
/**
|
|
@@ -22,15 +17,10 @@ export async function stoOpCheck(k) {
|
|
|
22
17
|
* @returns {Promise<any|null>}
|
|
23
18
|
*/
|
|
24
19
|
export async function stoOpGet(k) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
console.info(`key=${k} value=\n`, v);
|
|
30
|
-
return v;
|
|
31
|
-
} catch (e) {
|
|
32
|
-
return null;
|
|
33
|
-
}
|
|
20
|
+
let key = k.toString();
|
|
21
|
+
let objGet = await browser.storage.local.get(key);
|
|
22
|
+
let v = objGet[key];
|
|
23
|
+
return v;
|
|
34
24
|
}
|
|
35
25
|
|
|
36
26
|
/**
|
|
@@ -38,12 +28,7 @@ export async function stoOpGet(k) {
|
|
|
38
28
|
* @returns {Promise<{[p: string]: any}|null>}
|
|
39
29
|
*/
|
|
40
30
|
export async function stoOpGetAll() {
|
|
41
|
-
|
|
42
|
-
return await browser.storage.local.get();
|
|
43
|
-
} catch (e) {
|
|
44
|
-
console.error(e);
|
|
45
|
-
return null;
|
|
46
|
-
}
|
|
31
|
+
return await browser.storage.local.get();
|
|
47
32
|
}
|
|
48
33
|
|
|
49
34
|
/**
|
|
@@ -52,14 +37,9 @@ export async function stoOpGetAll() {
|
|
|
52
37
|
* @returns {Promise<string[]|null>}
|
|
53
38
|
*/
|
|
54
39
|
export async function stoOpQueryStartWith(k) {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
return keys.filter(value => value.startsWith(k.toString()));
|
|
59
|
-
} catch (e) {
|
|
60
|
-
console.error(e);
|
|
61
|
-
return null;
|
|
62
|
-
}
|
|
40
|
+
let objAll = await browser.storage.local.get();
|
|
41
|
+
let keys = Object.keys(objAll);
|
|
42
|
+
return keys.filter(value => value.startsWith(k.toString()));
|
|
63
43
|
}
|
|
64
44
|
|
|
65
45
|
/**
|
|
@@ -82,11 +62,8 @@ export async function stoOpSet(k, v) {
|
|
|
82
62
|
* @returns {Promise<void>}
|
|
83
63
|
*/
|
|
84
64
|
export async function stoOpRem(k) {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
await browser.storage.local.remove(key);
|
|
88
|
-
} catch (e) {
|
|
89
|
-
}
|
|
65
|
+
let key = k.toString();
|
|
66
|
+
await browser.storage.local.remove(key);
|
|
90
67
|
}
|
|
91
68
|
|
|
92
69
|
/**
|
package/src/opTab.js
CHANGED
|
@@ -30,13 +30,12 @@ export async function tabOpCreateNear(properties) {
|
|
|
30
30
|
delete properties.tabId;
|
|
31
31
|
Object.assign(properties, {
|
|
32
32
|
index: tabPrev.index + 1, openerTabId: tabPrev.id,
|
|
33
|
-
})
|
|
33
|
+
});
|
|
34
34
|
|
|
35
35
|
let tab = await tabOpCreate(properties);
|
|
36
36
|
return tabOpEnhance(tab);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
|
|
40
39
|
/**
|
|
41
40
|
* {active: false, muted: true}
|
|
42
41
|
* @param properties{browser.tabs._CreateCreateProperties}
|
|
@@ -121,11 +120,7 @@ export async function tabOpReload(tabId) {
|
|
|
121
120
|
* @returns {Promise<void>}
|
|
122
121
|
*/
|
|
123
122
|
export async function tabOpRemove(tabId) {
|
|
124
|
-
try {
|
|
125
123
|
await browser.tabs.remove(tabId);
|
|
126
|
-
} catch (e) {
|
|
127
|
-
console.error(e);
|
|
128
|
-
}
|
|
129
124
|
}
|
|
130
125
|
|
|
131
126
|
/**
|
|
@@ -134,11 +129,7 @@ export async function tabOpRemove(tabId) {
|
|
|
134
129
|
* @returns {Promise<void>}
|
|
135
130
|
*/
|
|
136
131
|
export async function tabOpHide(tabId) {
|
|
137
|
-
|
|
138
|
-
await browser.tabs.hide(tabId);
|
|
139
|
-
} catch (e) {
|
|
140
|
-
console.error(e);
|
|
141
|
-
}
|
|
132
|
+
await browser.tabs.hide(tabId);
|
|
142
133
|
}
|
|
143
134
|
|
|
144
135
|
/**
|
package/src/serviceCommon.js
CHANGED
|
@@ -15,7 +15,7 @@ export async function serviceDownloadByDownlink(message) {
|
|
|
15
15
|
await browserDownloadByDownlink(message);
|
|
16
16
|
await browserNotificationCreate(`downloading! ${filename}`);
|
|
17
17
|
} catch (e) {
|
|
18
|
-
await browserNotificationCreate(`reason=${e}`)
|
|
18
|
+
await browserNotificationCreate(`reason=${e}`);
|
|
19
19
|
await browserDownloadByDownlink({downlink});
|
|
20
20
|
}
|
|
21
21
|
|
package/src/serviceFetch.js
CHANGED
|
@@ -1,35 +1,24 @@
|
|
|
1
|
-
import {browserNotificationCreate} from './browserNotification.js';
|
|
2
|
-
|
|
3
1
|
/**
|
|
4
2
|
*
|
|
5
3
|
* @param serverUrl{string}
|
|
6
4
|
* @param message{{}}
|
|
7
|
-
* @param handleError{function}
|
|
8
5
|
* @returns {Promise<Response>}
|
|
9
6
|
*/
|
|
10
7
|
export async function servicePostJson(
|
|
11
8
|
serverUrl,
|
|
12
9
|
message,
|
|
13
|
-
handleError,
|
|
14
10
|
) {
|
|
15
11
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
console.info('fetchResponse');
|
|
27
|
-
console.info(fetchResponse);
|
|
28
|
-
return fetchResponse;
|
|
29
|
-
} catch (e) {
|
|
30
|
-
handleError(e);
|
|
31
|
-
}
|
|
12
|
+
let body = JSON.stringify(message);
|
|
13
|
+
const fetchResponse = await fetch(serverUrl, {
|
|
14
|
+
method: 'POST',
|
|
15
|
+
headers: {
|
|
16
|
+
'Content-Type': 'application/json',
|
|
17
|
+
},
|
|
18
|
+
body: body,
|
|
19
|
+
});
|
|
32
20
|
|
|
21
|
+
return fetchResponse;
|
|
33
22
|
}
|
|
34
23
|
|
|
35
24
|
/**
|
|
@@ -63,22 +52,14 @@ export async function serviceSendDataToLocalAria2(message) {
|
|
|
63
52
|
params,
|
|
64
53
|
};
|
|
65
54
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
});
|
|
75
|
-
console.info(`response=\n`, response);
|
|
76
|
-
|
|
77
|
-
return response;
|
|
78
|
-
} catch (e) {
|
|
79
|
-
await browserNotificationCreate(e)
|
|
80
|
-
console.error(e);
|
|
81
|
-
return null;
|
|
82
|
-
}
|
|
55
|
+
const response = await fetch(`http://localhost:${port}/jsonrpc`, {
|
|
56
|
+
method: 'POST',
|
|
57
|
+
headers: {
|
|
58
|
+
Accept: 'application/json',
|
|
59
|
+
'Content-Type': 'application/json;charset=UTF-8',
|
|
60
|
+
},
|
|
61
|
+
body: JSON.stringify(data),
|
|
62
|
+
});
|
|
83
63
|
|
|
64
|
+
return response;
|
|
84
65
|
}
|
package/src/serviceGet.js
CHANGED
|
@@ -27,7 +27,6 @@ export async function serviceTakeScreenshot(
|
|
|
27
27
|
}) {
|
|
28
28
|
|
|
29
29
|
const tag = 'actTakeScreenshot()';
|
|
30
|
-
console.info(tag, `rect=\n`, rect);
|
|
31
30
|
let dataURI = await browser.tabs.captureTab(tabId, {
|
|
32
31
|
rect: rect,
|
|
33
32
|
});
|
|
@@ -320,11 +319,9 @@ export async function serviceDealWithMagnetLink(message) {
|
|
|
320
319
|
|
|
321
320
|
let {title, data, handleOption} = message;
|
|
322
321
|
let titleCleaned = serviceRemoveIllegalWord(title);
|
|
323
|
-
console.info(`data.length=\n`, data.length);
|
|
324
322
|
|
|
325
323
|
if (Array.isArray(data) && data.length >= 1) {
|
|
326
324
|
let content = `${data.join('\n')}\n`;
|
|
327
|
-
console.info(`content=\n`, content);
|
|
328
325
|
|
|
329
326
|
let filename = [
|
|
330
327
|
'magnet-link',
|
|
@@ -21,7 +21,6 @@ export async function serviceUpdataALLTextNodeColor(message) {
|
|
|
21
21
|
* @returns {Promise<void>}
|
|
22
22
|
*/
|
|
23
23
|
func: async (message) => {
|
|
24
|
-
// console.log('serviceShowPanelChangeTextStyle func(message)');
|
|
25
24
|
let {color} = message;
|
|
26
25
|
updateStyleColor(color);
|
|
27
26
|
|
|
@@ -51,11 +50,10 @@ export async function serviceUpdataALLTextNodeColor(message) {
|
|
|
51
50
|
}
|
|
52
51
|
|
|
53
52
|
const arr = nativeTreeWalkerFindALLElementHasNodeText();
|
|
54
|
-
// console.info(arr);
|
|
55
53
|
|
|
56
54
|
if (arr.length) {
|
|
57
55
|
arr.forEach(value => {
|
|
58
|
-
value
|
|
56
|
+
value['style'].color = color;
|
|
59
57
|
});
|
|
60
58
|
}
|
|
61
59
|
}
|
|
@@ -88,7 +86,6 @@ export async function serviceUpdataALLNodeBackgroundColor(message) {
|
|
|
88
86
|
* @returns {Promise<void>}
|
|
89
87
|
*/
|
|
90
88
|
func: async (message) => {
|
|
91
|
-
// console.log('serviceShowPanelChangeTextStyle func(message)');
|
|
92
89
|
let {backgroundColor} = message;
|
|
93
90
|
updateStyleBackgroundColor(backgroundColor);
|
|
94
91
|
|
|
@@ -119,11 +116,10 @@ export async function serviceUpdataALLNodeBackgroundColor(message) {
|
|
|
119
116
|
* @type {Node[]}
|
|
120
117
|
*/
|
|
121
118
|
const arr = nativeTreeWalker();
|
|
122
|
-
// console.info(arr);
|
|
123
119
|
|
|
124
120
|
if (arr.length) {
|
|
125
121
|
arr.forEach(value => {
|
|
126
|
-
value
|
|
122
|
+
value['style'].backgroundColor = backgroundColor;
|
|
127
123
|
});
|
|
128
124
|
}
|
|
129
125
|
}
|
|
@@ -6,8 +6,8 @@ import {stoOpGet, stoOpSet} from './opStorage.js';
|
|
|
6
6
|
* @returns {Promise<void>}
|
|
7
7
|
*/
|
|
8
8
|
export async function serviceInitUserSettings(userSettings) {
|
|
9
|
-
const initPromises = Object.entries(userSettings)
|
|
10
|
-
map(async ([key, setting]) => {
|
|
9
|
+
const initPromises = Object.entries(userSettings)
|
|
10
|
+
.map(async ([key, setting]) => {
|
|
11
11
|
const oldValue = await stoOpGet(key);
|
|
12
12
|
|
|
13
13
|
// FIX: Check strictly for null or undefined.
|