webext-schema 5.5.7 → 5.6.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/schema.js CHANGED
@@ -206,12 +206,12 @@ export class Schema {
206
206
  const { $ref, properties, type, unsupported } = item;
207
207
  if (!unsupported) {
208
208
  $ref && this._refMap.set(`${namespace}.${key}`, { $ref, namespace });
209
- if (Object.prototype.hasOwnProperty.call(item, 'value')) {
209
+ if (Object.hasOwn(item, 'value')) {
210
210
  target[key] = item.value;
211
211
  } else if (type === 'function') {
212
212
  target[key] = this._sandbox.stub();
213
213
  } else if (type === 'object' || $ref ||
214
- Object.prototype.hasOwnProperty.call(item, 'properties')) {
214
+ Object.hasOwn(item, 'properties')) {
215
215
  target[key] ??= {};
216
216
  properties && this._mockProperties(
217
217
  target[key], properties, `${namespace}.${key}`
package/modules/update.js CHANGED
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * update.js
3
3
  */
4
+ /* eslint-disable no-await-in-loop */
4
5
 
5
6
  /* api */
6
7
  import path from 'node:path';
@@ -13,7 +14,7 @@ import { createFile } from './file-util.js';
13
14
  import { CHAR, INDENT } from './constant.js';
14
15
  const DIR_CWD = process.cwd();
15
16
  const PERM_FILE = 0o644;
16
- export const ESR_VER = 128;
17
+ export const ESR_VER = 115;
17
18
 
18
19
  /**
19
20
  * fetch text
@@ -116,14 +117,14 @@ export const getAllSchemaData = async (baseUrl, info) => {
116
117
  throw new TypeError(`Expected String but got ${getType(baseUrl)}.`);
117
118
  }
118
119
  const items = await getFileList(baseUrl);
119
- const func = [];
120
+ const schemas = [];
120
121
  for (const item of items) {
121
122
  if (info) {
122
123
  console.info(`Fetching ${item}`);
123
124
  }
124
- func.push(getSchemaData(item, baseUrl));
125
+ const schema = await getSchemaData(item, baseUrl);
126
+ schemas.push(schema);
125
127
  }
126
- const schemas = await Promise.all(func);
127
128
  return schemas;
128
129
  };
129
130
 
@@ -141,14 +142,14 @@ export const getListedSchemaData = async (baseUrl, arr, info) => {
141
142
  if (!Array.isArray(arr)) {
142
143
  throw new TypeError(`Expected Array but got ${getType(arr)}.`);
143
144
  }
144
- const func = [];
145
+ const schemas = [];
145
146
  for (const item of arr) {
146
147
  if (info) {
147
148
  console.info(`Fetching ${item}`);
148
149
  }
149
- func.push(getSchemaData(item, baseUrl));
150
+ const schema = await getSchemaData(item, baseUrl);
151
+ schemas.push(schema);
150
152
  }
151
- const schemas = await Promise.all(func);
152
153
  return schemas;
153
154
  };
154
155
 
@@ -168,16 +169,16 @@ export const getMailExtSchemaData = async (baseUrl, info) => {
168
169
  'commands.json',
169
170
  'pkcs11.json'
170
171
  ];
171
- const func = [];
172
+ const schemas = [];
172
173
  for (const item of items) {
173
174
  if (!excludeFile.includes(item)) {
174
175
  if (info) {
175
176
  console.info(`Fetching ${item}`);
176
177
  }
177
- func.push(getSchemaData(item, schemaUrl));
178
+ const schema = await getSchemaData(item, schemaUrl);
179
+ schemas.push(schema);
178
180
  }
179
181
  }
180
- const schemas = await Promise.all(func);
181
182
  return schemas;
182
183
  };
183
184
 
package/package.json CHANGED
@@ -19,44 +19,44 @@
19
19
  "types": "types/index.d.ts",
20
20
  "dependencies": {
21
21
  "camelize": "^1.0.1",
22
- "commander": "^13.1.0",
22
+ "commander": "^14.0.0",
23
23
  "decamelize": "^6.0.0",
24
24
  "json5": "^2.2.3",
25
- "sinon": "^20.0.0"
25
+ "sinon": "^21.0.0"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@types/firefox-webext-browser": "^120.0.4",
29
- "@types/node": "^22.15.3",
29
+ "@types/node": "^24.1.0",
30
30
  "@types/sinon": "^17.0.4",
31
31
  "c8": "^10.1.3",
32
- "eslint": "^9.25.1",
33
- "eslint-plugin-jsdoc": "^50.6.11",
34
- "eslint-plugin-regexp": "^2.7.0",
35
- "eslint-plugin-unicorn": "^59.0.0",
36
- "globals": "^16.0.0",
37
- "mocha": "^11.2.2",
38
- "neostandard": "^0.12.1",
39
- "npm-run-all2": "^7.0.2",
40
- "typescript": "^5.8.3",
41
- "undici": "^7.8.0"
32
+ "eslint": "^9.32.0",
33
+ "eslint-plugin-jsdoc": "^52.0.2",
34
+ "eslint-plugin-regexp": "^2.9.1",
35
+ "eslint-plugin-unicorn": "^60.0.0",
36
+ "globals": "^16.3.0",
37
+ "mocha": "^11.7.1",
38
+ "neostandard": "^0.12.2",
39
+ "npm-run-all2": "^8.0.4",
40
+ "typescript": "^5.9.2",
41
+ "undici": "^7.13.0"
42
42
  },
43
43
  "scripts": {
44
44
  "build": "npm run tsc && npm run lint && npm run test",
45
45
  "lint": "eslint . --fix",
46
46
  "start": "node index",
47
- "test": "npm run test-central",
48
- "test-beta": "c8 mocha --require=test/mocha/setup.js --channel=beta --exit test/*.test.js",
49
- "test-central": "c8 mocha --require=test/mocha/setup.js --channel=central --exit test/*.test.js",
50
- "test-esr": "c8 mocha --require=test/mocha/setup.js --channel=esr --exit test/*.test.js",
51
- "test-release": "c8 mocha --require=test/mocha/setup.js --channel=release --exit test/*.test.js",
52
- "test_all": "npm-run-all -s test-*",
47
+ "test": "npm run test:central",
48
+ "test:beta": "c8 mocha --require=test/mocha/setup.js --channel=beta --exit test/*.test.js",
49
+ "test:central": "c8 mocha --require=test/mocha/setup.js --channel=central --exit test/*.test.js",
50
+ "test:esr": "c8 mocha --require=test/mocha/setup.js --channel=esr --exit test/*.test.js",
51
+ "test:release": "c8 mocha --require=test/mocha/setup.js --channel=release --exit test/*.test.js",
52
+ "testall": "npm-run-all -s test:*",
53
53
  "tsc": "node index clean --dir=types -i && npx tsc",
54
54
  "update": "node index update -i",
55
- "update-beta": "node index update --channel=beta -i",
56
- "update-central": "node index update --channel=central -i",
57
- "update-esr": "node index update --channel=esr -i",
58
- "update-mail": "node index update --channel=mail -i",
59
- "update-release": "node index update --channel=release -i"
55
+ "update:beta": "node index update --channel=beta -i",
56
+ "update:central": "node index update --channel=central -i",
57
+ "update:esr": "node index update --channel=esr -i",
58
+ "update:mail": "node index update --channel=mail -i",
59
+ "update:release": "node index update --channel=release -i"
60
60
  },
61
- "version": "5.5.7"
61
+ "version": "5.6.1"
62
62
  }
@@ -4434,7 +4434,6 @@
4434
4434
  {
4435
4435
  "type": "object",
4436
4436
  "name": "queryInfo",
4437
- "optional": true,
4438
4437
  "properties": {
4439
4438
  "collapsed": {
4440
4439
  "type": "boolean",
@@ -4543,6 +4542,16 @@
4543
4542
  {
4544
4543
  "$ref": "TabGroup",
4545
4544
  "name": "group"
4545
+ },
4546
+ {
4547
+ "type": "object",
4548
+ "name": "removeInfo",
4549
+ "properties": {
4550
+ "isWindowClosing": {
4551
+ "type": "boolean",
4552
+ "description": "True when the tab group is being closed because its window is being closed."
4553
+ }
4554
+ }
4546
4555
  }
4547
4556
  ]
4548
4557
  },
@@ -5059,6 +5068,10 @@
5059
5068
  "windowId": {
5060
5069
  "type": "integer",
5061
5070
  "optional": true
5071
+ },
5072
+ "cookieStoreId": {
5073
+ "type": "string",
5074
+ "optional": true
5062
5075
  }
5063
5076
  }
5064
5077
  }
@@ -8287,6 +8300,24 @@
8287
8300
  "optional": true
8288
8301
  }
8289
8302
  ]
8303
+ },
8304
+ {
8305
+ "name": "onUserSettingsChanged",
8306
+ "type": "function",
8307
+ "description": "Fired when user-specified settings relating to an extension's action change.",
8308
+ "parameters": [
8309
+ {
8310
+ "name": "change",
8311
+ "type": "object",
8312
+ "properties": {
8313
+ "isOnToolbar": {
8314
+ "type": "boolean",
8315
+ "description": "Whether the extension's action icon is visible on browser windows' top-level toolbar (i.e., whether the extension has been 'pinned' by the user).",
8316
+ "optional": true
8317
+ }
8318
+ }
8319
+ }
8320
+ ]
8290
8321
  }
8291
8322
  ]
8292
8323
  },
@@ -8427,6 +8458,10 @@
8427
8458
  "zoomSiteSpecific": {
8428
8459
  "$ref": "types.Setting",
8429
8460
  "description": "This boolean setting controls whether zoom is applied on a per-site basis or to the current tab only. If privacy.resistFingerprinting is true, this setting has no effect and zoom is applied to the current tab only."
8461
+ },
8462
+ "verticalTabs": {
8463
+ "$ref": "types.Setting",
8464
+ "description": "This boolean setting controls whether vertical tabs are enabled."
8430
8465
  }
8431
8466
  }
8432
8467
  },
@@ -9410,6 +9445,7 @@
9410
9445
  "id": "SameSiteStatus",
9411
9446
  "type": "string",
9412
9447
  "enum": [
9448
+ "unspecified",
9413
9449
  "no_restriction",
9414
9450
  "lax",
9415
9451
  "strict"
@@ -9703,7 +9739,7 @@
9703
9739
  "$ref": "SameSiteStatus",
9704
9740
  "optional": true,
9705
9741
  "description": "The cookie's same-site status.",
9706
- "default": "no_restriction"
9742
+ "default": "unspecified"
9707
9743
  },
9708
9744
  "expirationDate": {
9709
9745
  "type": "number",
@@ -9957,7 +9993,7 @@
9957
9993
  {
9958
9994
  "id": "ResourceType",
9959
9995
  "type": "string",
9960
- "description": "How the requested resource will be used. Comparable to the webRequest.ResourceType type.",
9996
+ "description": "How the requested resource will be used. Comparable to the webRequest.ResourceType type. object_subrequest is unsupported.",
9961
9997
  "enum": [
9962
9998
  "main_frame",
9963
9999
  "sub_frame",
@@ -13019,6 +13055,28 @@
13019
13055
  "description": "Message localized for current locale."
13020
13056
  }
13021
13057
  },
13058
+ {
13059
+ "name": "getPreferredSystemLanguages",
13060
+ "type": "function",
13061
+ "async": "callback",
13062
+ "description": "Gets the preferred locales of the operating system. This is different from the locales set in the browser; to get those, use $(ref:i18n.getAcceptLanguages).",
13063
+ "parameters": [
13064
+ {
13065
+ "type": "function",
13066
+ "name": "callback",
13067
+ "parameters": [
13068
+ {
13069
+ "name": "languages",
13070
+ "type": "array",
13071
+ "items": {
13072
+ "$ref": "LanguageCode"
13073
+ },
13074
+ "description": "Array of LanguageCode"
13075
+ }
13076
+ ]
13077
+ }
13078
+ ]
13079
+ },
13022
13080
  {
13023
13081
  "name": "getUILanguage",
13024
13082
  "type": "function",
@@ -14323,12 +14381,13 @@
14323
14381
  "enum": [
14324
14382
  "authenticationInfo",
14325
14383
  "bookmarksInfo",
14326
- "browsingHistory",
14384
+ "browsingActivity",
14327
14385
  "financialAndPaymentInfo",
14328
14386
  "healthInfo",
14329
14387
  "locationInfo",
14330
14388
  "personalCommunications",
14331
14389
  "personallyIdentifyingInfo",
14390
+ "searchTerms",
14332
14391
  "websiteActivity",
14333
14392
  "websiteContent"
14334
14393
  ]
@@ -14487,6 +14546,11 @@
14487
14546
  },
14488
14547
  "optional": true,
14489
14548
  "default": []
14549
+ },
14550
+ "has_previous_consent": {
14551
+ "type": "boolean",
14552
+ "optional": true,
14553
+ "default": false
14490
14554
  }
14491
14555
  }
14492
14556
  }
@@ -20906,7 +20970,6 @@
20906
20970
  "script",
20907
20971
  "image",
20908
20972
  "object",
20909
- "object_subrequest",
20910
20973
  "xmlhttprequest",
20911
20974
  "xslt",
20912
20975
  "ping",
@@ -21333,7 +21396,6 @@
21333
21396
  "cryptomining_content",
21334
21397
  "emailtracking",
21335
21398
  "emailtracking_content",
21336
- "consentmanager",
21337
21399
  "tracking",
21338
21400
  "tracking_ad",
21339
21401
  "tracking_analytics",
@@ -21341,7 +21403,9 @@
21341
21403
  "tracking_content",
21342
21404
  "any_basic_tracking",
21343
21405
  "any_strict_tracking",
21344
- "any_social_tracking"
21406
+ "any_social_tracking",
21407
+ "consentmanager",
21408
+ "antifraud"
21345
21409
  ],
21346
21410
  "description": "Tracking flags that match our internal tracking classification"
21347
21411
  },
@@ -4434,7 +4434,6 @@
4434
4434
  {
4435
4435
  "type": "object",
4436
4436
  "name": "queryInfo",
4437
- "optional": true,
4438
4437
  "properties": {
4439
4438
  "collapsed": {
4440
4439
  "type": "boolean",
@@ -4543,6 +4542,16 @@
4543
4542
  {
4544
4543
  "$ref": "TabGroup",
4545
4544
  "name": "group"
4545
+ },
4546
+ {
4547
+ "type": "object",
4548
+ "name": "removeInfo",
4549
+ "properties": {
4550
+ "isWindowClosing": {
4551
+ "type": "boolean",
4552
+ "description": "True when the tab group is being closed because its window is being closed."
4553
+ }
4554
+ }
4546
4555
  }
4547
4556
  ]
4548
4557
  },
@@ -5059,6 +5068,10 @@
5059
5068
  "windowId": {
5060
5069
  "type": "integer",
5061
5070
  "optional": true
5071
+ },
5072
+ "cookieStoreId": {
5073
+ "type": "string",
5074
+ "optional": true
5062
5075
  }
5063
5076
  }
5064
5077
  }
@@ -8287,6 +8300,24 @@
8287
8300
  "optional": true
8288
8301
  }
8289
8302
  ]
8303
+ },
8304
+ {
8305
+ "name": "onUserSettingsChanged",
8306
+ "type": "function",
8307
+ "description": "Fired when user-specified settings relating to an extension's action change.",
8308
+ "parameters": [
8309
+ {
8310
+ "name": "change",
8311
+ "type": "object",
8312
+ "properties": {
8313
+ "isOnToolbar": {
8314
+ "type": "boolean",
8315
+ "description": "Whether the extension's action icon is visible on browser windows' top-level toolbar (i.e., whether the extension has been 'pinned' by the user).",
8316
+ "optional": true
8317
+ }
8318
+ }
8319
+ }
8320
+ ]
8290
8321
  }
8291
8322
  ]
8292
8323
  },
@@ -8427,6 +8458,10 @@
8427
8458
  "zoomSiteSpecific": {
8428
8459
  "$ref": "types.Setting",
8429
8460
  "description": "This boolean setting controls whether zoom is applied on a per-site basis or to the current tab only. If privacy.resistFingerprinting is true, this setting has no effect and zoom is applied to the current tab only."
8461
+ },
8462
+ "verticalTabs": {
8463
+ "$ref": "types.Setting",
8464
+ "description": "This boolean setting controls whether vertical tabs are enabled."
8430
8465
  }
8431
8466
  }
8432
8467
  },
@@ -9410,6 +9445,7 @@
9410
9445
  "id": "SameSiteStatus",
9411
9446
  "type": "string",
9412
9447
  "enum": [
9448
+ "unspecified",
9413
9449
  "no_restriction",
9414
9450
  "lax",
9415
9451
  "strict"
@@ -9703,7 +9739,7 @@
9703
9739
  "$ref": "SameSiteStatus",
9704
9740
  "optional": true,
9705
9741
  "description": "The cookie's same-site status.",
9706
- "default": "no_restriction"
9742
+ "default": "unspecified"
9707
9743
  },
9708
9744
  "expirationDate": {
9709
9745
  "type": "number",
@@ -9957,7 +9993,7 @@
9957
9993
  {
9958
9994
  "id": "ResourceType",
9959
9995
  "type": "string",
9960
- "description": "How the requested resource will be used. Comparable to the webRequest.ResourceType type.",
9996
+ "description": "How the requested resource will be used. Comparable to the webRequest.ResourceType type. object_subrequest is unsupported.",
9961
9997
  "enum": [
9962
9998
  "main_frame",
9963
9999
  "sub_frame",
@@ -13019,6 +13055,28 @@
13019
13055
  "description": "Message localized for current locale."
13020
13056
  }
13021
13057
  },
13058
+ {
13059
+ "name": "getPreferredSystemLanguages",
13060
+ "type": "function",
13061
+ "async": "callback",
13062
+ "description": "Gets the preferred locales of the operating system. This is different from the locales set in the browser; to get those, use $(ref:i18n.getAcceptLanguages).",
13063
+ "parameters": [
13064
+ {
13065
+ "type": "function",
13066
+ "name": "callback",
13067
+ "parameters": [
13068
+ {
13069
+ "name": "languages",
13070
+ "type": "array",
13071
+ "items": {
13072
+ "$ref": "LanguageCode"
13073
+ },
13074
+ "description": "Array of LanguageCode"
13075
+ }
13076
+ ]
13077
+ }
13078
+ ]
13079
+ },
13022
13080
  {
13023
13081
  "name": "getUILanguage",
13024
13082
  "type": "function",
@@ -14323,12 +14381,13 @@
14323
14381
  "enum": [
14324
14382
  "authenticationInfo",
14325
14383
  "bookmarksInfo",
14326
- "browsingHistory",
14384
+ "browsingActivity",
14327
14385
  "financialAndPaymentInfo",
14328
14386
  "healthInfo",
14329
14387
  "locationInfo",
14330
14388
  "personalCommunications",
14331
14389
  "personallyIdentifyingInfo",
14390
+ "searchTerms",
14332
14391
  "websiteActivity",
14333
14392
  "websiteContent"
14334
14393
  ]
@@ -14487,6 +14546,11 @@
14487
14546
  },
14488
14547
  "optional": true,
14489
14548
  "default": []
14549
+ },
14550
+ "has_previous_consent": {
14551
+ "type": "boolean",
14552
+ "optional": true,
14553
+ "default": false
14490
14554
  }
14491
14555
  }
14492
14556
  }
@@ -17860,6 +17924,29 @@
17860
17924
  }
17861
17925
  ]
17862
17926
  },
17927
+ {
17928
+ "name": "getKeys",
17929
+ "type": "function",
17930
+ "description": "Gets the keys of all items in storage.",
17931
+ "async": "callback",
17932
+ "parameters": [
17933
+ {
17934
+ "name": "callback",
17935
+ "type": "function",
17936
+ "description": "Callback with the keys of all items in storage, or on failure (in which case $(ref:runtime.lastError) will be set).",
17937
+ "parameters": [
17938
+ {
17939
+ "name": "keys",
17940
+ "type": "array",
17941
+ "items": {
17942
+ "type": "string"
17943
+ },
17944
+ "description": "The keys of all items in storage."
17945
+ }
17946
+ ]
17947
+ }
17948
+ ]
17949
+ },
17863
17950
  {
17864
17951
  "name": "set",
17865
17952
  "type": "function",
@@ -18033,6 +18120,29 @@
18033
18120
  }
18034
18121
  ]
18035
18122
  },
18123
+ {
18124
+ "name": "getKeys",
18125
+ "type": "function",
18126
+ "description": "Gets the keys of all items in storage.",
18127
+ "async": "callback",
18128
+ "parameters": [
18129
+ {
18130
+ "name": "callback",
18131
+ "type": "function",
18132
+ "description": "Callback with the keys of all items in storage, or on failure (in which case $(ref:runtime.lastError) will be set).",
18133
+ "parameters": [
18134
+ {
18135
+ "name": "keys",
18136
+ "type": "array",
18137
+ "items": {
18138
+ "type": "string"
18139
+ },
18140
+ "description": "The keys of all items in storage."
18141
+ }
18142
+ ]
18143
+ }
18144
+ ]
18145
+ },
18036
18146
  {
18037
18147
  "name": "set",
18038
18148
  "type": "function",
@@ -20906,7 +21016,6 @@
20906
21016
  "script",
20907
21017
  "image",
20908
21018
  "object",
20909
- "object_subrequest",
20910
21019
  "xmlhttprequest",
20911
21020
  "xslt",
20912
21021
  "ping",
@@ -21333,7 +21442,6 @@
21333
21442
  "cryptomining_content",
21334
21443
  "emailtracking",
21335
21444
  "emailtracking_content",
21336
- "consentmanager",
21337
21445
  "tracking",
21338
21446
  "tracking_ad",
21339
21447
  "tracking_analytics",
@@ -21341,7 +21449,9 @@
21341
21449
  "tracking_content",
21342
21450
  "any_basic_tracking",
21343
21451
  "any_strict_tracking",
21344
- "any_social_tracking"
21452
+ "any_social_tracking",
21453
+ "consentmanager",
21454
+ "antifraud"
21345
21455
  ],
21346
21456
  "description": "Tracking flags that match our internal tracking classification"
21347
21457
  },