webext-schema 5.4.3 → 5.5.0

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.
@@ -39,7 +39,7 @@ export const createBookmark = async opt => {
39
39
  /**
40
40
  * get bookmark tree node
41
41
  * @param {string|Array} [id] - bookmark ID or array of bookmark IDs
42
- * @returns {Promise.<?Array>} - array of bookmarks.BookmarkTreeNode
42
+ * @returns {Promise.<?Array.<object>>} - array of bookmarks.BookmarkTreeNode
43
43
  */
44
44
  export const getBookmarkTreeNode = async id => {
45
45
  const isGranted = await isPermissionGranted({
@@ -182,7 +182,7 @@ export const updateCommand = async (id, value = '') => {
182
182
  /* contextualIdentities */
183
183
  /**
184
184
  * get all contextual identities
185
- * @returns {Promise.<?Array>} - array of contextualIdentities.ContextualIdentity
185
+ * @returns {Promise.<?Array.<object>>} - array of contextualIdentities.ContextualIdentity
186
186
  */
187
187
  export const getAllContextualIdentities = async () => {
188
188
  const isGranted = await isPermissionGranted({
@@ -219,7 +219,7 @@ export const getContextualId = async cookieStoreId => {
219
219
  /* management */
220
220
  /**
221
221
  * get enabled theme
222
- * @returns {Promise.<?Array>} - array of management.ExtensionInfo
222
+ * @returns {Promise.<?Array.<object>>} - array of management.ExtensionInfo
223
223
  */
224
224
  export const getEnabledTheme = async () => {
225
225
  const isGranted = await isPermissionGranted({
@@ -258,7 +258,7 @@ export const getExtensionInfo = async id => {
258
258
 
259
259
  /**
260
260
  * get external extensions
261
- * @returns {Promise.<?Array|boolean>} - array of management.extensionInfo
261
+ * @returns {Promise.<?Array.<object>>} - array of management.extensionInfo
262
262
  */
263
263
  export const getExternalExtensions = async () => {
264
264
  const isGranted = await isPermissionGranted({
@@ -469,7 +469,7 @@ export const isScriptingAvailable = async () => {
469
469
  /**
470
470
  * execute script to tab
471
471
  * @param {object} opt - options
472
- * @returns {Promise.<?Array|boolean>} - array of InjectionResult object
472
+ * @returns {Promise.<?Array.<object>>} - array of InjectionResult object
473
473
  */
474
474
  export const executeScriptToTab = async (opt = {}) => {
475
475
  const { args, injectImmediately, files, func, target } = opt;
@@ -496,6 +496,32 @@ export const executeScriptToTab = async (opt = {}) => {
496
496
  };
497
497
 
498
498
  /* search */
499
+ /**
500
+ * search in new tab
501
+ * @param {string} text - query string
502
+ * @param {object} opt - create tab options
503
+ * @returns {Promise.<object>} - tabs.Tab
504
+ */
505
+ export const searchInNewTab = async (text, opt) => {
506
+ if (!isString(text)) {
507
+ throw new TypeError(`Expected String but got ${getType(text)}.`);
508
+ }
509
+ const isGranted = await isPermissionGranted({
510
+ permissions: ['search']
511
+ });
512
+ let tab;
513
+ if (isGranted) {
514
+ const { search } = browser;
515
+ const { id: tabId } = await tabs.create(isObjectNotEmpty(opt) ? opt : null);
516
+ await search.query({
517
+ tabId,
518
+ text
519
+ });
520
+ tab = await tabs.get(tabId);
521
+ }
522
+ return tab ?? null;
523
+ };
524
+
499
525
  /**
500
526
  * search with a search engine
501
527
  * @param {string} query - search query
@@ -732,7 +758,7 @@ export const duplicateTab = async (tabId, opt) => {
732
758
  /**
733
759
  * query tabs
734
760
  * @param {object} opt - options
735
- * @returns {Promise.<?Array>} - result
761
+ * @returns {Promise.<Array.<object>>} - array of tabs.Tab
736
762
  */
737
763
  export const queryTabs = async opt => {
738
764
  const res = await tabs.query(opt);
@@ -852,7 +878,7 @@ export const getActiveTabId = async windowId => {
852
878
  /**
853
879
  * get all tabs in window
854
880
  * @param {number} [windowId] - window ID
855
- * @returns {Promise.<?Array>} - array of tabs.Tab
881
+ * @returns {Promise.<Array.<object>>} - array of tabs.Tab
856
882
  */
857
883
  export const getAllTabsInWindow = async windowId => {
858
884
  if (!Number.isInteger(windowId)) {
@@ -868,7 +894,7 @@ export const getAllTabsInWindow = async windowId => {
868
894
  /**
869
895
  * get highlighted tab
870
896
  * @param {number} [windowId] - window ID
871
- * @returns {Promise.<?Array>} - array of tabs.Tab
897
+ * @returns {Promise.<Array.<object>>} - array of tabs.Tab
872
898
  */
873
899
  export const getHighlightedTab = async windowId => {
874
900
  if (!Number.isInteger(windowId)) {
@@ -923,7 +949,7 @@ export const highlightTab = async (index, windowId) => {
923
949
  * move tab
924
950
  * @param {number|Array} tabId - tab ID
925
951
  * @param {object} [opt] - options
926
- * @returns {Promise.<?Array>} - array of tabs.Tab
952
+ * @returns {Promise.<?Array.<object>>} - array of tabs.Tab
927
953
  */
928
954
  export const moveTab = async (tabId, opt) => {
929
955
  if (!(Array.isArray(tabId) || Number.isInteger(tabId))) {
@@ -1083,7 +1109,7 @@ export const createNewWindow = async opt => {
1083
1109
  /**
1084
1110
  * get all windows
1085
1111
  * @param {boolean} populate - populate tabs
1086
- * @returns {Promise.<Array>} - array of windows.Window
1112
+ * @returns {Promise.<Array.<object>>} - array of windows.Window
1087
1113
  */
1088
1114
  export const getAllNormalWindows = async (populate = false) => {
1089
1115
  const arr = await windows.getAll({
package/modules/schema.js CHANGED
@@ -55,6 +55,7 @@ export class Schema {
55
55
 
56
56
  /**
57
57
  * get target from namespace key
58
+ * @private
58
59
  * @param {string} key - namespace key
59
60
  * @returns {object} - target object
60
61
  */
@@ -81,6 +82,7 @@ export class Schema {
81
82
 
82
83
  /**
83
84
  * assign imported values
85
+ * @private
84
86
  * @returns {void}
85
87
  */
86
88
  _assignImportMap() {
@@ -107,6 +109,7 @@ export class Schema {
107
109
 
108
110
  /**
109
111
  * assign referred values
112
+ * @private
110
113
  * @returns {void}
111
114
  */
112
115
  _assignRefMap() {
@@ -133,6 +136,7 @@ export class Schema {
133
136
 
134
137
  /**
135
138
  * mock events
139
+ * @private
136
140
  * @param {object} target - target object
137
141
  * @param {Array} events - events
138
142
  * @returns {object} - target object
@@ -158,6 +162,7 @@ export class Schema {
158
162
 
159
163
  /**
160
164
  * mock functions
165
+ * @private
161
166
  * @param {object} target - target object
162
167
  * @param {Array} funcs - functions
163
168
  * @returns {object} - target object
@@ -180,6 +185,7 @@ export class Schema {
180
185
 
181
186
  /**
182
187
  * mock properties
188
+ * @private
183
189
  * @param {object} target - target object
184
190
  * @param {object} props - properties
185
191
  * @param {string} namespace - namespace
@@ -220,6 +226,7 @@ export class Schema {
220
226
 
221
227
  /**
222
228
  * mock types
229
+ * @private
223
230
  * @param {object} target - target object
224
231
  * @param {Array} types - types
225
232
  * @param {string} namespace - namespace
@@ -257,6 +264,7 @@ export class Schema {
257
264
 
258
265
  /**
259
266
  * parse schema content
267
+ * @private
260
268
  * @returns {object} - schema
261
269
  */
262
270
  _parseSchemaContent() {
@@ -274,7 +282,7 @@ export class Schema {
274
282
  /**
275
283
  * get schema
276
284
  * @param {string} name - API name or file name
277
- * @returns {Array} - schema
285
+ * @returns {?Array.<object>} - schema
278
286
  */
279
287
  get(name) {
280
288
  if (!isString(name)) {
@@ -304,7 +312,7 @@ export class Schema {
304
312
 
305
313
  /**
306
314
  * list schemas
307
- * @returns {Array} - file list
315
+ * @returns {Array.<string>} - file list
308
316
  */
309
317
  list() {
310
318
  const schemas = this._schema ?? this._parseSchemaContent();
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';
@@ -108,46 +109,57 @@ export const getFileList = async baseUrl => {
108
109
  /**
109
110
  * get all schema data
110
111
  * @param {string} baseUrl - base URL
111
- * @returns {Promise.<Array>} - schemas data in array
112
+ * @param {boolean} info - console info
113
+ * @returns {Promise.<Array.<object>>} - schemas data in array
112
114
  */
113
- export const getAllSchemaData = async baseUrl => {
115
+ export const getAllSchemaData = async (baseUrl, info) => {
114
116
  if (!isString(baseUrl)) {
115
117
  throw new TypeError(`Expected String but got ${getType(baseUrl)}.`);
116
118
  }
119
+ const schemas = [];
117
120
  const items = await getFileList(baseUrl);
118
- const func = [];
119
121
  for (const item of items) {
120
- func.push(getSchemaData(item, baseUrl));
122
+ if (info) {
123
+ console.info(`Fetching ${item}`);
124
+ }
125
+ const schema = await getSchemaData(item, baseUrl);
126
+ schemas.push(schema);
121
127
  }
122
- return Promise.all(func);
128
+ return schemas;
123
129
  };
124
130
 
125
131
  /**
126
132
  * get listed schema data
127
133
  * @param {string} baseUrl - base URL
128
134
  * @param {Array} arr - array of schema file names
129
- * @returns {Promise.<Array>} - schema data in array
135
+ * @param {boolean} info - console info
136
+ * @returns {Promise.<Array.<object>>} - schema data in array
130
137
  */
131
- export const getListedSchemaData = async (baseUrl, arr) => {
138
+ export const getListedSchemaData = async (baseUrl, arr, info) => {
132
139
  if (!isString(baseUrl)) {
133
140
  throw new TypeError(`Expected String but got ${getType(baseUrl)}.`);
134
141
  }
135
142
  if (!Array.isArray(arr)) {
136
143
  throw new TypeError(`Expected Array but got ${getType(arr)}.`);
137
144
  }
138
- const func = [];
145
+ const schemas = [];
139
146
  for (const item of arr) {
140
- func.push(getSchemaData(item, baseUrl));
147
+ if (info) {
148
+ console.info(`Fetching ${item}`);
149
+ }
150
+ const schema = await getSchemaData(item, baseUrl);
151
+ schemas.push(schema);
141
152
  }
142
- return Promise.all(func);
153
+ return schemas;
143
154
  };
144
155
 
145
156
  /**
146
157
  * get MailExtensions schema data
147
158
  * @param {string} baseUrl - base URL
148
- * @returns {Promise.<Array>} - results of each handler
159
+ * @param {boolean} info - console info
160
+ * @returns {Promise.<Array.<object>>} - results of each handler
149
161
  */
150
- export const getMailExtSchemaData = async baseUrl => {
162
+ export const getMailExtSchemaData = async (baseUrl, info) => {
151
163
  if (!isString(baseUrl)) {
152
164
  throw new TypeError(`Expected String but got ${getType(baseUrl)}.`);
153
165
  }
@@ -157,19 +169,26 @@ export const getMailExtSchemaData = async baseUrl => {
157
169
  'commands.json',
158
170
  'pkcs11.json'
159
171
  ];
160
- const func = [];
172
+ const schemas = [];
161
173
  for (const item of items) {
162
- !excludeFile.includes(item) && func.push(getSchemaData(item, schemaUrl));
174
+ if (!excludeFile.includes(item)) {
175
+ if (info) {
176
+ console.info(`Fetching ${item}`);
177
+ }
178
+ const schema = await getSchemaData(item, schemaUrl);
179
+ schemas.push(schema);
180
+ }
163
181
  }
164
- return Promise.all(func);
182
+ return schemas;
165
183
  };
166
184
 
167
185
  /**
168
186
  * create unified schema
169
187
  * @param {string} channel - release channel
188
+ * @param {boolean} info - console info
170
189
  * @returns {Promise.<object>} - schema
171
190
  */
172
- export const createUnifiedSchema = async channel => {
191
+ export const createUnifiedSchema = async (channel, info) => {
173
192
  const channelUrl = getChannelUrl(channel);
174
193
  const schema = {};
175
194
  let arr;
@@ -187,14 +206,16 @@ export const createUnifiedSchema = async channel => {
187
206
  const toolkitBaseUrl =
188
207
  `${getChannelUrl('central')}toolkit/components/extensions/schemas/`;
189
208
  arr = await Promise.all([
190
- getListedSchemaData(browserBaseUrl, browserItems),
191
- getListedSchemaData(toolkitBaseUrl, toolkitItems),
192
- getMailExtSchemaData(`${channelUrl}mail/components/extensions/`)
209
+ getListedSchemaData(browserBaseUrl, browserItems, info),
210
+ getListedSchemaData(toolkitBaseUrl, toolkitItems, info),
211
+ getMailExtSchemaData(`${channelUrl}mail/components/extensions/`, info)
193
212
  ]);
194
213
  } else {
195
214
  arr = await Promise.all([
196
- getAllSchemaData(`${channelUrl}browser/components/extensions/schemas/`),
197
- getAllSchemaData(`${channelUrl}toolkit/components/extensions/schemas/`)
215
+ getAllSchemaData(`${channelUrl}browser/components/extensions/schemas/`,
216
+ info),
217
+ getAllSchemaData(`${channelUrl}toolkit/components/extensions/schemas/`,
218
+ info)
198
219
  ]);
199
220
  }
200
221
  for (const items of arr) {
@@ -216,7 +237,7 @@ export const saveSchemaFile = async (channel, info) => {
216
237
  if (!isString(channel)) {
217
238
  throw new TypeError(`Expected String but got ${getType(channel)}.`);
218
239
  }
219
- const schema = await createUnifiedSchema(channel);
240
+ const schema = await createUnifiedSchema(channel, info);
220
241
  const content = `${JSON.stringify(schema, null, INDENT)}\n`;
221
242
  const fileName = channel === 'mail' ? 'mailext' : 'webext';
222
243
  const filePath =
package/package.json CHANGED
@@ -21,20 +21,21 @@
21
21
  },
22
22
  "devDependencies": {
23
23
  "@types/firefox-webext-browser": "^120.0.4",
24
- "@types/node": "^22.7.4",
24
+ "@types/node": "^22.8.2",
25
25
  "@types/sinon": "^17.0.3",
26
26
  "c8": "^10.1.2",
27
- "chai": "^5.1.1",
28
- "eslint": "^8.57.0",
29
- "eslint-config-standard": "^17.1.0",
30
- "eslint-plugin-import": "^2.30.0",
31
- "eslint-plugin-jsdoc": "^50.3.0",
27
+ "chai": "^5.1.2",
28
+ "eslint": "^9.13.0",
29
+ "eslint-plugin-import-x": "^4.3.1",
30
+ "eslint-plugin-jsdoc": "^50.4.3",
32
31
  "eslint-plugin-regexp": "^2.6.0",
33
- "eslint-plugin-unicorn": "^55.0.0",
32
+ "eslint-plugin-unicorn": "^56.0.0",
33
+ "globals": "^15.11.0",
34
34
  "mocha": "^10.7.3",
35
- "npm-run-all": "^4.1.5",
36
- "typescript": "^5.6.2",
37
- "undici": "^6.19.8"
35
+ "neostandard": "^0.11.7",
36
+ "npm-run-all2": "^7.0.1",
37
+ "typescript": "^5.6.3",
38
+ "undici": "^6.20.1"
38
39
  },
39
40
  "scripts": {
40
41
  "build": "npm run tsc && npm run lint && npm run test",
@@ -54,5 +55,5 @@
54
55
  "update-mail": "node index update --channel=mail -i",
55
56
  "update-release": "node index update --channel=release -i"
56
57
  },
57
- "version": "5.4.3"
58
+ "version": "5.5.0"
58
59
  }
@@ -9085,6 +9085,11 @@
9085
9085
  "type": "string",
9086
9086
  "optional": true,
9087
9087
  "description": "The first-party URL of the cookie, if the cookie is in storage partitioned by the top-level site."
9088
+ },
9089
+ "hasCrossSiteAncestor": {
9090
+ "type": "boolean",
9091
+ "optional": true,
9092
+ "description": "Whether or not the cookie is in a third-party context, respecting ancestor chains."
9088
9093
  }
9089
9094
  }
9090
9095
  },
@@ -12439,7 +12444,8 @@
12439
12444
  "responsiveness",
12440
12445
  "cpufreq",
12441
12446
  "bandwidth",
12442
- "memory"
12447
+ "memory",
12448
+ "tracing"
12443
12449
  ]
12444
12450
  },
12445
12451
  {
@@ -17703,64 +17709,6 @@
17703
17709
  {
17704
17710
  "namespace": "manifest",
17705
17711
  "types": [
17706
- {
17707
- "$extend": "WebExtensionManifest",
17708
- "properties": {
17709
- "telemetry": {
17710
- "type": "object",
17711
- "optional": true,
17712
- "additionalProperties": {
17713
- "$ref": "UnrecognizedProperty"
17714
- },
17715
- "properties": {
17716
- "ping_type": {
17717
- "type": "string"
17718
- },
17719
- "schemaNamespace": {
17720
- "type": "string"
17721
- },
17722
- "public_key": {
17723
- "type": "object",
17724
- "properties": {
17725
- "id": {
17726
- "type": "string"
17727
- },
17728
- "key": {
17729
- "type": "object",
17730
- "properties": {
17731
- "crv": {
17732
- "type": "string",
17733
- "optional": "false"
17734
- },
17735
- "kty": {
17736
- "type": "string",
17737
- "optional": "false"
17738
- },
17739
- "x": {
17740
- "type": "string",
17741
- "optional": "false"
17742
- },
17743
- "y": {
17744
- "type": "string",
17745
- "optional": "false"
17746
- }
17747
- }
17748
- }
17749
- }
17750
- },
17751
- "study_name": {
17752
- "type": "string",
17753
- "optional": true
17754
- },
17755
- "pioneer_id": {
17756
- "type": "boolean",
17757
- "optional": true,
17758
- "default": false
17759
- }
17760
- }
17761
- }
17762
- }
17763
- },
17764
17712
  {
17765
17713
  "$extend": "PermissionPrivileged",
17766
17714
  "choices": [
@@ -17917,39 +17865,6 @@
17917
17865
  }
17918
17866
  ]
17919
17867
  },
17920
- {
17921
- "name": "submitEncryptedPing",
17922
- "type": "function",
17923
- "description": "Submits a custom ping to the Telemetry back-end, with an encrypted payload. Requires a telemetry entry in the manifest to be used.",
17924
- "parameters": [
17925
- {
17926
- "name": "message",
17927
- "type": "object",
17928
- "additionalProperties": {
17929
- "type": "any"
17930
- },
17931
- "description": "The data payload for the ping, which will be encrypted."
17932
- },
17933
- {
17934
- "description": "Options object.",
17935
- "name": "options",
17936
- "type": "object",
17937
- "properties": {
17938
- "schemaName": {
17939
- "type": "string",
17940
- "optional": false,
17941
- "description": "Schema name used for payload."
17942
- },
17943
- "schemaVersion": {
17944
- "type": "integer",
17945
- "optional": false,
17946
- "description": "Schema version used for payload."
17947
- }
17948
- }
17949
- }
17950
- ],
17951
- "async": true
17952
- },
17953
17868
  {
17954
17869
  "name": "canUpload",
17955
17870
  "type": "function",
@@ -18118,6 +18033,7 @@
18118
18033
  },
18119
18034
  {
18120
18035
  "name": "recordEvent",
18036
+ "deprecated": "`recordEvent` is a no-op since Firefox 132 (see bug 1894533)",
18121
18037
  "type": "function",
18122
18038
  "description": "Record an event in Telemetry. Throws when trying to record an unknown event.",
18123
18039
  "async": true,
@@ -18177,6 +18093,7 @@
18177
18093
  },
18178
18094
  {
18179
18095
  "name": "registerEvents",
18096
+ "deprecated": "`registerEvents` is a no-op since Firefox 132 (see bug 1894533)",
18180
18097
  "type": "function",
18181
18098
  "description": "Register new events to record them from addons. See nsITelemetry.idl for more details.",
18182
18099
  "async": true,
@@ -18198,8 +18115,9 @@
18198
18115
  },
18199
18116
  {
18200
18117
  "name": "setEventRecordingEnabled",
18118
+ "deprecated": "`setEventRecordingEnabled` is a no-op since Firefox 133 (see bug 1920562)",
18201
18119
  "type": "function",
18202
- "description": "Enable recording of events in a category. Events default to recording disabled. This allows to toggle recording for all events in the specified category.",
18120
+ "description": "Enable recording of events in a category. Events default to recording enabled. This allows to toggle recording for all events in the specified category.",
18203
18121
  "async": true,
18204
18122
  "parameters": [
18205
18123
  {
@@ -12444,7 +12444,8 @@
12444
12444
  "responsiveness",
12445
12445
  "cpufreq",
12446
12446
  "bandwidth",
12447
- "memory"
12447
+ "memory",
12448
+ "tracing"
12448
12449
  ]
12449
12450
  },
12450
12451
  {
@@ -18032,7 +18033,7 @@
18032
18033
  },
18033
18034
  {
18034
18035
  "name": "recordEvent",
18035
- "deprecated": "`recordEvent` has been deprecated since Firefox 132 (see bug 1894533)",
18036
+ "deprecated": "`recordEvent` is a no-op since Firefox 132 (see bug 1894533)",
18036
18037
  "type": "function",
18037
18038
  "description": "Record an event in Telemetry. Throws when trying to record an unknown event.",
18038
18039
  "async": true,
@@ -18092,7 +18093,7 @@
18092
18093
  },
18093
18094
  {
18094
18095
  "name": "registerEvents",
18095
- "deprecated": "`registerEvents` has been deprecated since Firefox 132 (see bug 1894533)",
18096
+ "deprecated": "`registerEvents` is a no-op since Firefox 132 (see bug 1894533)",
18096
18097
  "type": "function",
18097
18098
  "description": "Register new events to record them from addons. See nsITelemetry.idl for more details.",
18098
18099
  "async": true,
@@ -18114,8 +18115,9 @@
18114
18115
  },
18115
18116
  {
18116
18117
  "name": "setEventRecordingEnabled",
18118
+ "deprecated": "`setEventRecordingEnabled` is a no-op since Firefox 133 (see bug 1920562)",
18117
18119
  "type": "function",
18118
- "description": "Enable recording of events in a category. Events default to recording disabled. This allows to toggle recording for all events in the specified category.",
18120
+ "description": "Enable recording of events in a category. Events default to recording enabled. This allows to toggle recording for all events in the specified category.",
18119
18121
  "async": true,
18120
18122
  "parameters": [
18121
18123
  {
@@ -8631,7 +8631,7 @@
8631
8631
  "STORAGE",
8632
8632
  "MESSAGE"
8633
8633
  ],
8634
- "description": "The type of the quota as defined by RFC2087. A <var>STORAGE</var> quota is constraining the available storage in bytes, a <var>MESSAGE</var> quota is constraining the number of storable messages."
8634
+ "description": "The type of the quota as defined by RFC 2087. A <var>STORAGE</var> quota is constraining the available storage in bytes, a <var>MESSAGE</var> quota is constraining the number of storable messages."
8635
8635
  },
8636
8636
  "limit": {
8637
8637
  "type": "integer",
@@ -10611,7 +10611,7 @@
10611
10611
  {
10612
10612
  "name": "getSelectedFolders",
10613
10613
  "type": "function",
10614
- "description": "Lists the selected folders in the folder pane.",
10614
+ "description": "Lists the selected folders in the folder pane. Does not include folders which are context-clicked, but not selected. The context-clicked folders are always returned by the $(ref:menus.onClicked) event of the menus API.",
10615
10615
  "permissions": [
10616
10616
  "accountsRead"
10617
10617
  ],
@@ -10642,7 +10642,7 @@
10642
10642
  {
10643
10643
  "name": "getSelectedMessages",
10644
10644
  "type": "function",
10645
- "description": "Lists the selected messages in the current folder.",
10645
+ "description": "Lists the selected messages in the current folder. Includes messages in collapsed threads. Does not include messages which are context-clicked, but not selected. The context-clicked messages are always returned by the $(ref:menus.onClicked) event of the menus API.",
10646
10646
  "permissions": [
10647
10647
  "messagesRead"
10648
10648
  ],
@@ -10670,7 +10670,7 @@
10670
10670
  {
10671
10671
  "name": "setSelectedMessages",
10672
10672
  "type": "function",
10673
- "description": "Selects none, one or multiple messages.",
10673
+ "description": "Selects none, one or multiple messages. Opens collapsed threads to show the selection, if required.",
10674
10674
  "permissions": [
10675
10675
  "messagesRead",
10676
10676
  "accountsRead"
@@ -12886,7 +12886,7 @@
12886
12886
  "properties": {
12887
12887
  "body": {
12888
12888
  "type": "string",
12889
- "description": "The content of the part.",
12889
+ "description": "The quoted-printable or base64 decoded content of the part. Only present for parts with a content type of <var>text/*</var> and only if requested, see the <var>decodeContent</var> option of $(ref:messages.getFull). Use $(ref:messages.getAttachmentFile) to retrieve the content of parts which have a content type other than <var>text/*</var>.",
12890
12890
  "optional": true
12891
12891
  },
12892
12892
  "contentType": {
@@ -12906,7 +12906,7 @@
12906
12906
  },
12907
12907
  "headers": {
12908
12908
  "type": "object",
12909
- "description": "A <em>dictionary object</em> of part headers as <em>key-value</em> pairs, with the header name as <em>key</em>, and an array of headers as <em>value</em>.",
12909
+ "description": "A <em>dictionary object</em> of RFC 2047 decoded part headers as <em>key-value</em> pairs, with the header name as <em>key</em>, and an array of headers as <em>value</em>. Only present if requested, see the <var>decodeHeaders</var> option of $(ref:messages.getFull).",
12910
12910
  "optional": true,
12911
12911
  "additionalProperties": {
12912
12912
  "type": "array",
@@ -12933,6 +12933,22 @@
12933
12933
  "description": "Any sub-parts of this part.",
12934
12934
  "optional": true
12935
12935
  },
12936
+ "rawBody": {
12937
+ "type": "string",
12938
+ "description": "The raw content of the part. Only present if requested, see the <var>decodeContent</var> option of $(ref:messages.getFull).",
12939
+ "optional": true
12940
+ },
12941
+ "rawHeaders": {
12942
+ "type": "object",
12943
+ "description": "A <em>dictionary object</em> of raw part headers as <em>key-value</em> pairs, with the header name as <em>key</em>, and an array of headers as <em>value</em>. Only present if requested, see the <var>decodeHeaders</var> option of $(ref:messages.getFull).",
12944
+ "optional": true,
12945
+ "additionalProperties": {
12946
+ "type": "array",
12947
+ "items": {
12948
+ "type": "string"
12949
+ }
12950
+ }
12951
+ },
12936
12952
  "size": {
12937
12953
  "type": "integer",
12938
12954
  "optional": true,
@@ -13252,7 +13268,17 @@
13252
13268
  "properties": {
13253
13269
  "decrypt": {
13254
13270
  "type": "boolean",
13255
- "description": "Whether the message should be decrypted. If the message could not be decrypted, its parts are omitted. Defaults to true.",
13271
+ "description": "Whether the message should be decrypted. If the message could not be decrypted, its parts are omitted. Defaults to <var>true</var>.",
13272
+ "optional": true
13273
+ },
13274
+ "decodeHeaders": {
13275
+ "type": "boolean",
13276
+ "description": "Whether to decode RFC 2047 encoded headers of message parts. Defaults to <var>true</var>. **Note:** Automatic decoding of headers containing a list of comma separated mailbox strings can have unwanted side effects. Example: <literalinclude>includes/messages/badHeader.js<lang>JavaScript</lang></literalinclude>",
13277
+ "optional": true
13278
+ },
13279
+ "decodeContent": {
13280
+ "type": "boolean",
13281
+ "description": "Whether to decode quoted-printable or base64 encoded content of message parts. Defaults to <var>true</var>.",
13256
13282
  "optional": true
13257
13283
  }
13258
13284
  },
@@ -13273,12 +13299,20 @@
13273
13299
  {
13274
13300
  "name": "getRaw",
13275
13301
  "type": "function",
13276
- "description": "Returns the unmodified source of a message. Throws if the message could not be read, for example due to network issues.",
13302
+ "description": "Returns the raw content of a message. Throws if the message could not be read, for example due to network issues.",
13277
13303
  "async": "callback",
13278
13304
  "parameters": [
13279
13305
  {
13280
- "name": "messageId",
13281
- "$ref": "messages.MessageId"
13306
+ "name": "message",
13307
+ "description": "Either a $(ref:messages.MessageId) of an existing message, or a $(ref:messages.MessagePart) with raw header and raw content data representing a full RFC 822 message (the provided data will be used as-is without applying any further encoding). See the <var>decodeHeaders</var> and <var>decodeContent</var> options of $(ref:messages.getFull) for further details on how to retrieve a $(ref:messages.MessagePart) with raw values. You can use $(ref:messengerUtilities.decodeMimeHeader) and $(ref:messengerUtilities.encodeMimeHeader) to manipulate a raw MessagePart.",
13308
+ "choices": [
13309
+ {
13310
+ "$ref": "messages.MessageId"
13311
+ },
13312
+ {
13313
+ "$ref": "messages.MessagePart"
13314
+ }
13315
+ ]
13282
13316
  },
13283
13317
  {
13284
13318
  "name": "options",
@@ -13399,7 +13433,7 @@
13399
13433
  {
13400
13434
  "name": "partName",
13401
13435
  "type": "string",
13402
- "pattern": "^\\d+(\\.\\d+)*$"
13436
+ "pattern": "^\\d+(\\.\\d+\\$?)*$"
13403
13437
  },
13404
13438
  {
13405
13439
  "type": "function",
@@ -13829,7 +13863,7 @@
13829
13863
  "name": "import",
13830
13864
  "type": "function",
13831
13865
  "max_manifest_version": 2,
13832
- "description": "Imports a message into a local Thunderbird folder. To import a message into an IMAP folder, add it to a local folder first and then move it to the IMAP folder.",
13866
+ "description": "Imports a message into a folder. Supports local folders, POP and IMAP folders. Throws, if the destination folder already contains a message with the Message-ID of the message being imported.",
13833
13867
  "async": "callback",
13834
13868
  "permissions": [
13835
13869
  "accountsRead",
@@ -13876,7 +13910,7 @@
13876
13910
  "name": "import",
13877
13911
  "type": "function",
13878
13912
  "min_manifest_version": 3,
13879
- "description": "Imports a message into a local Thunderbird folder. To import a message into an IMAP folder, add it to a local folder first and then move it to the IMAP folder.",
13913
+ "description": "Imports a message into a folder. Supports local folders, POP and IMAP folders. Throws, if the destination folder already contains a message with the Message-ID of the message being imported.",
13880
13914
  "async": "callback",
13881
13915
  "permissions": [
13882
13916
  "accountsRead",
@@ -15841,6 +15875,31 @@
15841
15875
  "description": "The members of the group, if available."
15842
15876
  }
15843
15877
  }
15878
+ },
15879
+ {
15880
+ "id": "MailboxHeaders",
15881
+ "type": "string",
15882
+ "description": "MIME headers, which by default are treated as containing one or more mailbox strings.",
15883
+ "enum": [
15884
+ "bcc",
15885
+ "cc",
15886
+ "from",
15887
+ "reply-to",
15888
+ "resent-bcc",
15889
+ "resent-cc",
15890
+ "resent-from",
15891
+ "resent-reply-to",
15892
+ "resent-sender",
15893
+ "resent-to",
15894
+ "sender",
15895
+ "to",
15896
+ "approved",
15897
+ "disposition-notification-to",
15898
+ "delivered-to",
15899
+ "return-receipt-to",
15900
+ "mail-reply-to",
15901
+ "mail-followup-to"
15902
+ ]
15844
15903
  }
15845
15904
  ],
15846
15905
  "functions": [
@@ -15933,6 +15992,96 @@
15933
15992
  ]
15934
15993
  }
15935
15994
  ]
15995
+ },
15996
+ {
15997
+ "name": "decodeMimeHeader",
15998
+ "type": "function",
15999
+ "description": "Decode the provided header into a readable format according to RFC 2047.",
16000
+ "async": "callback",
16001
+ "parameters": [
16002
+ {
16003
+ "name": "headerName",
16004
+ "type": "string"
16005
+ },
16006
+ {
16007
+ "name": "headerValue",
16008
+ "choices": [
16009
+ {
16010
+ "type": "string"
16011
+ },
16012
+ {
16013
+ "type": "array",
16014
+ "items": {
16015
+ "type": "string"
16016
+ }
16017
+ }
16018
+ ]
16019
+ },
16020
+ {
16021
+ "name": "isMailBoxHeader",
16022
+ "type": "boolean",
16023
+ "optional": true,
16024
+ "description": "Headers containing multiple mailbox strings need special handling. For example the header <var>=?UTF-8?Q?H=C3=B6rst=2C_Kenny?= <K.Hoerst@invalid>, new@thunderbird.bug</var> will be wrongly decoded to <var>Hörst, Kenny <K.Hoerst@invalid>, new@thunderbird.bug</var>, corrupting the structure of the first mailbox string. This option overrides the default behavior of treating the headers defined in $(ref:messengerUtilities.MailboxHeaders) as mailbox headers."
16025
+ },
16026
+ {
16027
+ "type": "function",
16028
+ "name": "callback",
16029
+ "optional": true,
16030
+ "parameters": [
16031
+ {
16032
+ "type": "array",
16033
+ "items": {
16034
+ "type": "string"
16035
+ }
16036
+ }
16037
+ ]
16038
+ }
16039
+ ]
16040
+ },
16041
+ {
16042
+ "name": "encodeMimeHeader",
16043
+ "type": "function",
16044
+ "description": "Encode the provided header according to RFC 2047.",
16045
+ "async": "callback",
16046
+ "parameters": [
16047
+ {
16048
+ "name": "headerName",
16049
+ "type": "string"
16050
+ },
16051
+ {
16052
+ "name": "headerValue",
16053
+ "choices": [
16054
+ {
16055
+ "type": "string"
16056
+ },
16057
+ {
16058
+ "type": "array",
16059
+ "items": {
16060
+ "type": "string"
16061
+ }
16062
+ }
16063
+ ]
16064
+ },
16065
+ {
16066
+ "name": "isMailBoxHeader",
16067
+ "type": "boolean",
16068
+ "optional": true,
16069
+ "description": "Headers containing multiple mailbox strings need special handling. This option overrides the default behavior of treating the headers defined in $(ref:messengerUtilities.MailboxHeaders) as mailbox headers."
16070
+ },
16071
+ {
16072
+ "type": "function",
16073
+ "name": "callback",
16074
+ "optional": true,
16075
+ "parameters": [
16076
+ {
16077
+ "type": "array",
16078
+ "items": {
16079
+ "type": "string"
16080
+ }
16081
+ }
16082
+ ]
16083
+ }
16084
+ ]
15936
16085
  }
15937
16086
  ]
15938
16087
  }
@@ -16260,7 +16409,7 @@
16260
16409
  "allowScriptsToClose": {
16261
16410
  "type": "boolean",
16262
16411
  "optional": true,
16263
- "description": "Allow scripts running inside the window to close the window by calling <code>window.close()</code>."
16412
+ "description": "Allow scripts running inside the window to close the window by calling <code>window.close()</code>. Defaults to <var>true</var> when the given URL points to an extension page (a page included with this extension and loaded with the <var>moz-extension:</var> protocol), defaults to <var>false</var> otherwise."
16264
16413
  },
16265
16414
  "cookieStoreId": {
16266
16415
  "type": "string",
@@ -9085,6 +9085,11 @@
9085
9085
  "type": "string",
9086
9086
  "optional": true,
9087
9087
  "description": "The first-party URL of the cookie, if the cookie is in storage partitioned by the top-level site."
9088
+ },
9089
+ "hasCrossSiteAncestor": {
9090
+ "type": "boolean",
9091
+ "optional": true,
9092
+ "description": "Whether or not the cookie is in a third-party context, respecting ancestor chains."
9088
9093
  }
9089
9094
  }
9090
9095
  },
@@ -17703,64 +17708,6 @@
17703
17708
  {
17704
17709
  "namespace": "manifest",
17705
17710
  "types": [
17706
- {
17707
- "$extend": "WebExtensionManifest",
17708
- "properties": {
17709
- "telemetry": {
17710
- "type": "object",
17711
- "optional": true,
17712
- "additionalProperties": {
17713
- "$ref": "UnrecognizedProperty"
17714
- },
17715
- "properties": {
17716
- "ping_type": {
17717
- "type": "string"
17718
- },
17719
- "schemaNamespace": {
17720
- "type": "string"
17721
- },
17722
- "public_key": {
17723
- "type": "object",
17724
- "properties": {
17725
- "id": {
17726
- "type": "string"
17727
- },
17728
- "key": {
17729
- "type": "object",
17730
- "properties": {
17731
- "crv": {
17732
- "type": "string",
17733
- "optional": "false"
17734
- },
17735
- "kty": {
17736
- "type": "string",
17737
- "optional": "false"
17738
- },
17739
- "x": {
17740
- "type": "string",
17741
- "optional": "false"
17742
- },
17743
- "y": {
17744
- "type": "string",
17745
- "optional": "false"
17746
- }
17747
- }
17748
- }
17749
- }
17750
- },
17751
- "study_name": {
17752
- "type": "string",
17753
- "optional": true
17754
- },
17755
- "pioneer_id": {
17756
- "type": "boolean",
17757
- "optional": true,
17758
- "default": false
17759
- }
17760
- }
17761
- }
17762
- }
17763
- },
17764
17711
  {
17765
17712
  "$extend": "PermissionPrivileged",
17766
17713
  "choices": [
@@ -17917,39 +17864,6 @@
17917
17864
  }
17918
17865
  ]
17919
17866
  },
17920
- {
17921
- "name": "submitEncryptedPing",
17922
- "type": "function",
17923
- "description": "Submits a custom ping to the Telemetry back-end, with an encrypted payload. Requires a telemetry entry in the manifest to be used.",
17924
- "parameters": [
17925
- {
17926
- "name": "message",
17927
- "type": "object",
17928
- "additionalProperties": {
17929
- "type": "any"
17930
- },
17931
- "description": "The data payload for the ping, which will be encrypted."
17932
- },
17933
- {
17934
- "description": "Options object.",
17935
- "name": "options",
17936
- "type": "object",
17937
- "properties": {
17938
- "schemaName": {
17939
- "type": "string",
17940
- "optional": false,
17941
- "description": "Schema name used for payload."
17942
- },
17943
- "schemaVersion": {
17944
- "type": "integer",
17945
- "optional": false,
17946
- "description": "Schema version used for payload."
17947
- }
17948
- }
17949
- }
17950
- ],
17951
- "async": true
17952
- },
17953
17867
  {
17954
17868
  "name": "canUpload",
17955
17869
  "type": "function",
@@ -18118,6 +18032,7 @@
18118
18032
  },
18119
18033
  {
18120
18034
  "name": "recordEvent",
18035
+ "deprecated": "`recordEvent` has been deprecated since Firefox 132 (see bug 1894533)",
18121
18036
  "type": "function",
18122
18037
  "description": "Record an event in Telemetry. Throws when trying to record an unknown event.",
18123
18038
  "async": true,
@@ -18177,6 +18092,7 @@
18177
18092
  },
18178
18093
  {
18179
18094
  "name": "registerEvents",
18095
+ "deprecated": "`registerEvents` has been deprecated since Firefox 132 (see bug 1894533)",
18180
18096
  "type": "function",
18181
18097
  "description": "Register new events to record them from addons. See nsITelemetry.idl for more details.",
18182
18098
  "async": true,
package/tsconfig.json CHANGED
@@ -12,5 +12,8 @@
12
12
  "resolveJsonModule": true,
13
13
  "target": "esnext"
14
14
  },
15
- "include": ["index.js", "modules/browser.js"]
15
+ "include": [
16
+ "index.js",
17
+ "modules/browser.js"
18
+ ]
16
19
  }
@@ -1,17 +1,17 @@
1
1
  export function isPermissionGranted(perm: object): Promise<boolean>;
2
2
  export function createBookmark(opt: object): Promise<object>;
3
- export function getBookmarkTreeNode(id?: string | any[]): Promise<any[] | null>;
3
+ export function getBookmarkTreeNode(id?: string | any[]): Promise<Array<object> | null>;
4
4
  export function getCloseTabsByDoubleClickValue(): Promise<object>;
5
5
  export function setContextMenuOnMouseup(): Promise<boolean>;
6
6
  export function clearContextMenuOnMouseup(): Promise<boolean>;
7
7
  export function getNewTabPositionValue(): Promise<object>;
8
8
  export function isCommandCustomizable(): Promise<boolean>;
9
9
  export function updateCommand(id: string, value?: string): Promise<void | null>;
10
- export function getAllContextualIdentities(): Promise<any[] | null>;
10
+ export function getAllContextualIdentities(): Promise<Array<object> | null>;
11
11
  export function getContextualId(cookieStoreId: string): Promise<object>;
12
- export function getEnabledTheme(): Promise<any[] | null>;
12
+ export function getEnabledTheme(): Promise<Array<object> | null>;
13
13
  export function getExtensionInfo(id: string): Promise<object>;
14
- export function getExternalExtensions(): Promise<(any[] | boolean) | null>;
14
+ export function getExternalExtensions(): Promise<Array<object> | null>;
15
15
  export function clearNotification(id: string): Promise<boolean | null>;
16
16
  export function createNotification(id: string, opt: object): Promise<string | null>;
17
17
  export function removePermission(perm: string | any[]): Promise<boolean>;
@@ -22,7 +22,8 @@ export function getOs(): Promise<string>;
22
22
  export function makeConnection(id?: number | string, info?: object | boolean): Promise<object>;
23
23
  export function sendMessage(id: number | string, msg: any, opt: object): Promise<object>;
24
24
  export function isScriptingAvailable(): Promise<boolean>;
25
- export function executeScriptToTab(opt?: object): Promise<(any[] | boolean) | null>;
25
+ export function executeScriptToTab(opt?: object): Promise<Array<object> | null>;
26
+ export function searchInNewTab(text: string, opt: object): Promise<object>;
26
27
  export function searchWithSearchEngine(query: string, opt?: object): Promise<void>;
27
28
  export function getRecentlyClosedTab(windowId?: number): Promise<object>;
28
29
  export function getSessionWindowValue(key: string, windowId?: number): Promise<string | null>;
@@ -35,17 +36,17 @@ export function removeStorage(key: any, area?: string): Promise<void>;
35
36
  export function setStorage(obj: object, area?: string): Promise<void>;
36
37
  export function createTab(opt?: object): Promise<object>;
37
38
  export function duplicateTab(tabId: number, opt: object): Promise<object>;
38
- export function queryTabs(opt: object): Promise<any[] | null>;
39
+ export function queryTabs(opt: object): Promise<Array<object>>;
39
40
  export function execScriptToTab(tabId: number | object, opt?: object): Promise<(any[] | boolean) | null>;
40
41
  export function execScriptToTabs(opt?: object): Promise<any[]>;
41
42
  export function execScriptsToTabInOrder(tabId: number | any[], opts?: any[]): Promise<any>;
42
43
  export function getActiveTab(windowId?: number): Promise<object>;
43
44
  export function getActiveTabId(windowId?: number): Promise<number | null>;
44
- export function getAllTabsInWindow(windowId?: number): Promise<any[] | null>;
45
- export function getHighlightedTab(windowId?: number): Promise<any[] | null>;
45
+ export function getAllTabsInWindow(windowId?: number): Promise<Array<object>>;
46
+ export function getHighlightedTab(windowId?: number): Promise<Array<object>>;
46
47
  export function getTab(tabId: number): Promise<object>;
47
48
  export function highlightTab(index: number | any[], windowId?: number): Promise<object>;
48
- export function moveTab(tabId: number | any[], opt?: object): Promise<any[] | null>;
49
+ export function moveTab(tabId: number | any[], opt?: object): Promise<Array<object> | null>;
49
50
  export function reloadTab(tabId: number, opt: object): Promise<void>;
50
51
  export function removeTab(arg: number | any[]): Promise<void>;
51
52
  export function updateTab(tabId: number, opt: object): Promise<object>;
@@ -54,7 +55,7 @@ export function captureVisibleTab(windowId: number, opt: object): Promise<string
54
55
  export function isTab(tabId: any): Promise<boolean>;
55
56
  export function getCurrentTheme(windowId?: number): Promise<object>;
56
57
  export function createNewWindow(opt: object): Promise<object>;
57
- export function getAllNormalWindows(populate?: boolean): Promise<any[]>;
58
+ export function getAllNormalWindows(populate?: boolean): Promise<Array<object>>;
58
59
  export function getCurrentWindow(opt: object): Promise<object>;
59
60
  export function getWindow(windowId: number, opt: object): Promise<object>;
60
61
  export function checkIncognitoWindowExists(): Promise<boolean>;
@@ -9,17 +9,17 @@ export class Schema {
9
9
  _schema: any;
10
10
  set channel(ch: any);
11
11
  get channel(): any;
12
- _getTargetFromNamespace(key: string): object;
13
- _assignImportMap(): void;
14
- _assignRefMap(): void;
15
- _mockEvents(target: object, events: any[]): object;
16
- _mockFunctions(target: object, funcs: any[]): object;
17
- _mockProperties(target: object, props: object, namespace: string): object;
18
- _mockTypes(target: object, types: any[], namespace: string): object;
19
- _parseSchemaContent(): object;
20
- get(name: string): any[];
12
+ private _getTargetFromNamespace;
13
+ private _assignImportMap;
14
+ private _assignRefMap;
15
+ private _mockEvents;
16
+ private _mockFunctions;
17
+ private _mockProperties;
18
+ private _mockTypes;
19
+ private _parseSchemaContent;
20
+ get(name: string): Array<object> | null;
21
21
  getAll(): object;
22
- list(): any[];
22
+ list(): Array<string>;
23
23
  mock(): object;
24
24
  #private;
25
25
  }
@@ -3,9 +3,9 @@ export function fetchText(url: string): Promise<string>;
3
3
  export function getChannelUrl(channel: string): string;
4
4
  export function getSchemaData(file: string, baseUrl: string): Promise<object>;
5
5
  export function getFileList(baseUrl: string): Promise<Array<string>>;
6
- export function getAllSchemaData(baseUrl: string): Promise<any[]>;
7
- export function getListedSchemaData(baseUrl: string, arr: any[]): Promise<any[]>;
8
- export function getMailExtSchemaData(baseUrl: string): Promise<any[]>;
9
- export function createUnifiedSchema(channel: string): Promise<object>;
6
+ export function getAllSchemaData(baseUrl: string, info: boolean): Promise<Array<object>>;
7
+ export function getListedSchemaData(baseUrl: string, arr: any[], info: boolean): Promise<Array<object>>;
8
+ export function getMailExtSchemaData(baseUrl: string, info: boolean): Promise<Array<object>>;
9
+ export function createUnifiedSchema(channel: string, info: boolean): Promise<object>;
10
10
  export function saveSchemaFile(channel: string, info: boolean): Promise<string>;
11
11
  export function updateSchemas(cmdOpts?: object): Promise<void>;