webext-schema 3.0.3 → 4.1.1
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/modules/browser.js +17 -4
- package/modules/update.js +1 -1
- package/package.json +16 -16
- package/schemas/esr/webext.json +809 -320
- package/schemas/mail/mailext.json +7 -5
- package/schemas/release/webext.json +27 -13
package/modules/browser.js
CHANGED
|
@@ -346,8 +346,9 @@ export const createNotification = async (id, opt) => {
|
|
|
346
346
|
let func;
|
|
347
347
|
if (isGranted) {
|
|
348
348
|
const { notifications } = browser;
|
|
349
|
-
!notifications.onClosed.hasListener(clearNotification)
|
|
349
|
+
if (!notifications.onClosed.hasListener(clearNotification)) {
|
|
350
350
|
notifications.onClosed.addListener(clearNotification);
|
|
351
|
+
}
|
|
351
352
|
func = notifications.create(id, opt);
|
|
352
353
|
}
|
|
353
354
|
return func || null;
|
|
@@ -411,6 +412,16 @@ export const getManifestIcons = () => {
|
|
|
411
412
|
return icons;
|
|
412
413
|
};
|
|
413
414
|
|
|
415
|
+
/**
|
|
416
|
+
* get manifest version
|
|
417
|
+
*
|
|
418
|
+
* @returns {number} - version
|
|
419
|
+
*/
|
|
420
|
+
export const getManifestVersion = () => {
|
|
421
|
+
const { manifest_version: version } = runtime.getManifest();
|
|
422
|
+
return version;
|
|
423
|
+
};
|
|
424
|
+
|
|
414
425
|
/**
|
|
415
426
|
* get OS
|
|
416
427
|
*
|
|
@@ -473,7 +484,7 @@ export const sendMessage = async (id, msg, opt) => {
|
|
|
473
484
|
} else if (id && isString(id)) {
|
|
474
485
|
func = runtime.sendMessage(id, msg, opt);
|
|
475
486
|
} else {
|
|
476
|
-
func = runtime.sendMessage(
|
|
487
|
+
func = runtime.sendMessage(msg, opt);
|
|
477
488
|
}
|
|
478
489
|
}
|
|
479
490
|
return func || null;
|
|
@@ -981,7 +992,9 @@ export const warmupTab = async tabId => {
|
|
|
981
992
|
if (!Number.isInteger(tabId)) {
|
|
982
993
|
throw new TypeError(`Expected Number but got ${getType(tabId)}.`);
|
|
983
994
|
}
|
|
984
|
-
typeof tabs.warmup === 'function'
|
|
995
|
+
if (typeof tabs.warmup === 'function') {
|
|
996
|
+
await tabs.warmup(tabId);
|
|
997
|
+
}
|
|
985
998
|
};
|
|
986
999
|
|
|
987
1000
|
/**
|
|
@@ -1083,7 +1096,7 @@ export const getWindow = async (windowId, opt) => {
|
|
|
1083
1096
|
export const checkIncognitoWindowExists = async () => {
|
|
1084
1097
|
const arr = await getAllNormalWindows();
|
|
1085
1098
|
let bool;
|
|
1086
|
-
if (arr
|
|
1099
|
+
if (arr?.length) {
|
|
1087
1100
|
for (const win of arr) {
|
|
1088
1101
|
bool = win.incognito;
|
|
1089
1102
|
if (bool) {
|
package/modules/update.js
CHANGED
package/package.json
CHANGED
|
@@ -14,39 +14,39 @@
|
|
|
14
14
|
"scripts": {
|
|
15
15
|
"lint": "eslint --fix .",
|
|
16
16
|
"start": "node index",
|
|
17
|
-
"test": "npm run test
|
|
18
|
-
"test
|
|
19
|
-
"test
|
|
20
|
-
"test
|
|
21
|
-
"test
|
|
22
|
-
"test_all": "npm-run-all -s test
|
|
17
|
+
"test": "npm run test-central",
|
|
18
|
+
"test-beta": "c8 mocha --require=test/mocha/setup.js --channel=beta --exit test/*.test.js",
|
|
19
|
+
"test-central": "c8 mocha --require=test/mocha/setup.js --channel=central --exit test/*.test.js",
|
|
20
|
+
"test-esr": "c8 mocha --require=test/mocha/setup.js --channel=esr --exit test/*.test.js",
|
|
21
|
+
"test-release": "c8 mocha --require=test/mocha/setup.js --channel=release --exit test/*.test.js",
|
|
22
|
+
"test_all": "npm-run-all -s test-*",
|
|
23
23
|
"update": "node index update -i",
|
|
24
|
-
"update
|
|
25
|
-
"update
|
|
26
|
-
"update
|
|
27
|
-
"update
|
|
28
|
-
"update
|
|
24
|
+
"update-beta": "node index update --channel=beta -i",
|
|
25
|
+
"update-central": "node index update --channel=central -i",
|
|
26
|
+
"update-esr": "node index update --channel=esr -i",
|
|
27
|
+
"update-mail": "node index update --channel=mail -i",
|
|
28
|
+
"update-release": "node index update --channel=release -i"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"camelize": "^1.0.0",
|
|
32
32
|
"commander": "^9.3.0",
|
|
33
33
|
"decamelize": "^6.0.0",
|
|
34
34
|
"json5": "^2.2.1",
|
|
35
|
-
"node-fetch": "^3.2.
|
|
35
|
+
"node-fetch": "^3.2.6",
|
|
36
36
|
"sinon": "^14.0.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"c8": "^7.11.3",
|
|
40
40
|
"chai": "^4.3.6",
|
|
41
|
-
"eslint": "^8.
|
|
41
|
+
"eslint": "^8.18.0",
|
|
42
42
|
"eslint-config-standard": "^17.0.0",
|
|
43
43
|
"eslint-plugin-import": "^2.26.0",
|
|
44
|
-
"eslint-plugin-jsdoc": "^39.3.
|
|
44
|
+
"eslint-plugin-jsdoc": "^39.3.3",
|
|
45
45
|
"eslint-plugin-node": "^11.1.0",
|
|
46
46
|
"eslint-plugin-promise": "^6.0.0",
|
|
47
47
|
"mocha": "^10.0.0",
|
|
48
|
-
"nock": "^13.2.
|
|
48
|
+
"nock": "^13.2.7",
|
|
49
49
|
"npm-run-all": "^4.1.5"
|
|
50
50
|
},
|
|
51
|
-
"version": "
|
|
51
|
+
"version": "4.1.1"
|
|
52
52
|
}
|