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.
@@ -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(runtime.id, msg, opt);
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' && await tabs.warmup(tabId);
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 && arr.length) {
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
@@ -15,7 +15,7 @@ import process from 'process';
15
15
  /* constants */
16
16
  const DIR_CWD = process.cwd();
17
17
  const PERM_FILE = 0o644;
18
- export const ESR_VER = 91;
18
+ export const ESR_VER = 102;
19
19
 
20
20
  /**
21
21
  * fetch text
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: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:*",
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: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"
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.4",
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.16.0",
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.2",
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.4",
48
+ "nock": "^13.2.7",
49
49
  "npm-run-all": "^4.1.5"
50
50
  },
51
- "version": "3.0.3"
51
+ "version": "4.1.1"
52
52
  }