webext-schema 2.3.2 → 3.0.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.
@@ -3,11 +3,11 @@
3
3
  */
4
4
 
5
5
  /* api */
6
- import { IS_WIN } from './constant.js';
7
6
  import { fileURLToPath } from 'url';
8
7
  import { getType, isString } from './common.js';
9
8
  import fs, { promises as fsPromise } from 'fs';
10
9
  import path from 'path';
10
+ import { IS_WIN } from './constant.js';
11
11
 
12
12
  /* constants */
13
13
  const MASK_BIT = 0o111;
@@ -135,7 +135,7 @@ export const getFileNameFromFilePath = (file, subst = SUBST) => {
135
135
  };
136
136
 
137
137
  /**
138
- * remove the directory and it's files
138
+ * remove the directory and it's files synchronously
139
139
  *
140
140
  * @param {string} dir - directory path
141
141
  * @param {string} baseDir - base directory path
@@ -146,16 +146,10 @@ export const removeDir = (dir, baseDir) => {
146
146
  if (!isSubDir(dir, baseDir)) {
147
147
  throw new Error(`${dir} is not a subdirectory of ${baseDir}.`);
148
148
  }
149
- const files = fs.readdirSync(dir);
150
- files.length && files.forEach(file => {
151
- const cur = path.join(dir, file);
152
- if (fs.lstatSync(cur).isDirectory()) {
153
- removeDir(cur, baseDir);
154
- } else {
155
- fs.unlinkSync(cur);
156
- }
149
+ fs.rmSync(dir, {
150
+ force: true,
151
+ recursive: true
157
152
  });
158
- fs.rmdirSync(dir);
159
153
  }
160
154
  };
161
155
 
@@ -167,7 +161,15 @@ export const removeDir = (dir, baseDir) => {
167
161
  * @returns {void}
168
162
  */
169
163
  export const removeDirectory = async (dir, baseDir) => {
170
- await removeDir(dir, baseDir);
164
+ if (isDir(dir)) {
165
+ if (!isSubDir(dir, baseDir)) {
166
+ throw new Error(`${dir} is not a subdirectory of ${baseDir}.`);
167
+ }
168
+ await fsPromise.rm(dir, {
169
+ force: true,
170
+ recursive: true
171
+ });
172
+ }
171
173
  };
172
174
 
173
175
  /**
package/modules/schema.js CHANGED
@@ -83,7 +83,7 @@ export class Schema {
83
83
  */
84
84
  _assignImportMap() {
85
85
  if (this._importMap.size) {
86
- const items = Array.from(this._importMap);
86
+ const items = [...this._importMap];
87
87
  for (const [key, value] of items) {
88
88
  const target = this._getTargetFromNamespace(key);
89
89
  if (target) {
@@ -111,7 +111,7 @@ export class Schema {
111
111
  */
112
112
  _assignRefMap() {
113
113
  if (this._refMap.size) {
114
- const items = Array.from(this._refMap);
114
+ const items = [...this._refMap];
115
115
  for (const [key, value] of items) {
116
116
  const target = this._getTargetFromNamespace(key);
117
117
  if (target) {
package/package.json CHANGED
@@ -32,21 +32,21 @@
32
32
  "commander": "^9.2.0",
33
33
  "decamelize": "^6.0.0",
34
34
  "json5": "^2.2.1",
35
- "node-fetch": "^3.2.3",
36
- "sinon": "^13.0.2"
35
+ "node-fetch": "^3.2.4",
36
+ "sinon": "^14.0.0"
37
37
  },
38
38
  "devDependencies": {
39
39
  "c8": "^7.11.2",
40
40
  "chai": "^4.3.6",
41
- "eslint": "^8.14.0",
41
+ "eslint": "^8.15.0",
42
42
  "eslint-config-standard": "^17.0.0",
43
43
  "eslint-plugin-import": "^2.26.0",
44
- "eslint-plugin-jsdoc": "^39.2.8",
44
+ "eslint-plugin-jsdoc": "^39.2.9",
45
45
  "eslint-plugin-node": "^11.1.0",
46
46
  "eslint-plugin-promise": "^6.0.0",
47
- "mocha": "^9.2.2",
47
+ "mocha": "^10.0.0",
48
48
  "nock": "^13.2.4",
49
49
  "npm-run-all": "^4.1.5"
50
50
  },
51
- "version": "2.3.2"
51
+ "version": "3.0.0"
52
52
  }
@@ -2611,6 +2611,7 @@
2611
2611
  },
2612
2612
  "onclick": {
2613
2613
  "type": "function",
2614
+ "max_manifest_version": 2,
2614
2615
  "optional": true,
2615
2616
  "description": "A function that will be called back when the menu item is clicked. Event pages cannot use this; instead, they should register a listener for $(ref:contextMenus.onClicked).",
2616
2617
  "parameters": [
@@ -2766,6 +2767,7 @@
2766
2767
  },
2767
2768
  "onclick": {
2768
2769
  "type": "function",
2770
+ "max_manifest_version": 2,
2769
2771
  "optional": "omit-key-if-missing",
2770
2772
  "parameters": [
2771
2773
  {
@@ -4343,12 +4345,6 @@
4343
4345
  "optional": true,
4344
4346
  "description": "The ID of the tab that opened this tab, if any. This property is only present if the opener tab still exists."
4345
4347
  },
4346
- "selected": {
4347
- "type": "boolean",
4348
- "description": "Whether the tab is selected.",
4349
- "deprecated": "Please use $(ref:tabs.Tab.highlighted).",
4350
- "unsupported": true
4351
- },
4352
4348
  "highlighted": {
4353
4349
  "type": "boolean",
4354
4350
  "description": "Whether the tab is highlighted. Works as an alias of active"
@@ -4802,36 +4798,6 @@
4802
4798
  "description": "A port that can be used to communicate with the content scripts running in the specified tab. The port's $(ref:runtime.Port) event is fired if the tab closes or does not exist. "
4803
4799
  }
4804
4800
  },
4805
- {
4806
- "name": "sendRequest",
4807
- "deprecated": "Please use $(ref:runtime.sendMessage).",
4808
- "unsupported": true,
4809
- "type": "function",
4810
- "description": "Sends a single request to the content script(s) in the specified tab, with an optional callback to run when a response is sent back. The $(ref:extension.onRequest) event is fired in each content script running in the specified tab for the current extension.",
4811
- "parameters": [
4812
- {
4813
- "type": "integer",
4814
- "name": "tabId",
4815
- "minimum": 0
4816
- },
4817
- {
4818
- "type": "any",
4819
- "name": "request"
4820
- },
4821
- {
4822
- "type": "function",
4823
- "name": "responseCallback",
4824
- "optional": true,
4825
- "parameters": [
4826
- {
4827
- "name": "response",
4828
- "type": "any",
4829
- "description": "The JSON response object sent by the handler of the request. If an error occurs while connecting to the specified tab, the callback will be called with no arguments and $(ref:runtime.lastError) will be set to the error message."
4830
- }
4831
- ]
4832
- }
4833
- ]
4834
- },
4835
4801
  {
4836
4802
  "name": "sendMessage",
4837
4803
  "type": "function",
@@ -4874,63 +4840,6 @@
4874
4840
  }
4875
4841
  ]
4876
4842
  },
4877
- {
4878
- "name": "getSelected",
4879
- "deprecated": "Please use $(ref:tabs.query) <code>{active: true}</code>.",
4880
- "unsupported": true,
4881
- "type": "function",
4882
- "description": "Gets the tab that is selected in the specified window.",
4883
- "async": "callback",
4884
- "parameters": [
4885
- {
4886
- "type": "integer",
4887
- "name": "windowId",
4888
- "minimum": -2,
4889
- "optional": true,
4890
- "description": "Defaults to the $(topic:current-window)[current window]."
4891
- },
4892
- {
4893
- "type": "function",
4894
- "name": "callback",
4895
- "parameters": [
4896
- {
4897
- "name": "tab",
4898
- "$ref": "Tab"
4899
- }
4900
- ]
4901
- }
4902
- ]
4903
- },
4904
- {
4905
- "name": "getAllInWindow",
4906
- "deprecated": "Please use $(ref:tabs.query) <code>{windowId: windowId}</code>.",
4907
- "unsupported": true,
4908
- "type": "function",
4909
- "description": "Gets details about all tabs in the specified window.",
4910
- "async": "callback",
4911
- "parameters": [
4912
- {
4913
- "type": "integer",
4914
- "name": "windowId",
4915
- "minimum": -2,
4916
- "optional": true,
4917
- "description": "Defaults to the $(topic:current-window)[current window]."
4918
- },
4919
- {
4920
- "type": "function",
4921
- "name": "callback",
4922
- "parameters": [
4923
- {
4924
- "name": "tabs",
4925
- "type": "array",
4926
- "items": {
4927
- "$ref": "Tab"
4928
- }
4929
- }
4930
- ]
4931
- }
4932
- ]
4933
- },
4934
4843
  {
4935
4844
  "name": "create",
4936
4845
  "type": "function",
@@ -4963,13 +4872,6 @@
4963
4872
  "optional": true,
4964
4873
  "description": "Whether the tab should become the active tab in the window. Does not affect whether the window is focused (see $(ref:windows.update)). Defaults to <var>true</var>."
4965
4874
  },
4966
- "selected": {
4967
- "deprecated": "Please use <em>active</em>.",
4968
- "unsupported": true,
4969
- "type": "boolean",
4970
- "optional": true,
4971
- "description": "Whether the tab should become the selected tab in the window. Defaults to <var>true</var>"
4972
- },
4973
4875
  "pinned": {
4974
4876
  "type": "boolean",
4975
4877
  "optional": true,
@@ -5319,13 +5221,6 @@
5319
5221
  "optional": true,
5320
5222
  "description": "Adds or removes the tab from the current selection."
5321
5223
  },
5322
- "selected": {
5323
- "unsupported": true,
5324
- "deprecated": "Please use <em>highlighted</em>.",
5325
- "type": "boolean",
5326
- "optional": true,
5327
- "description": "Whether the tab should be selected."
5328
- },
5329
5224
  "pinned": {
5330
5225
  "type": "boolean",
5331
5226
  "optional": true,
@@ -5639,6 +5534,7 @@
5639
5534
  {
5640
5535
  "name": "executeScript",
5641
5536
  "type": "function",
5537
+ "max_manifest_version": 2,
5642
5538
  "description": "Injects JavaScript code into a page. For details, see the $(topic:content_scripts)[programmatic injection] section of the content scripts doc.",
5643
5539
  "async": "callback",
5644
5540
  "parameters": [
@@ -5676,6 +5572,7 @@
5676
5572
  {
5677
5573
  "name": "insertCSS",
5678
5574
  "type": "function",
5575
+ "max_manifest_version": 2,
5679
5576
  "description": "Injects CSS into a page. For details, see the $(topic:content_scripts)[programmatic injection] section of the content scripts doc.",
5680
5577
  "async": "callback",
5681
5578
  "parameters": [
@@ -5703,6 +5600,7 @@
5703
5600
  {
5704
5601
  "name": "removeCSS",
5705
5602
  "type": "function",
5603
+ "max_manifest_version": 2,
5706
5604
  "description": "Removes injected CSS from a page. For details, see the $(topic:content_scripts)[programmatic injection] section of the content scripts doc.",
5707
5605
  "async": "callback",
5708
5606
  "parameters": [
@@ -6170,58 +6068,6 @@
6170
6068
  }
6171
6069
  ]
6172
6070
  },
6173
- {
6174
- "name": "onSelectionChanged",
6175
- "deprecated": "Please use $(ref:tabs.onActivated).",
6176
- "unsupported": true,
6177
- "type": "function",
6178
- "description": "Fires when the selected tab in a window changes.",
6179
- "parameters": [
6180
- {
6181
- "type": "integer",
6182
- "name": "tabId",
6183
- "minimum": 0,
6184
- "description": "The ID of the tab that has become active."
6185
- },
6186
- {
6187
- "type": "object",
6188
- "name": "selectInfo",
6189
- "properties": {
6190
- "windowId": {
6191
- "type": "integer",
6192
- "minimum": 0,
6193
- "description": "The ID of the window the selected tab changed inside of."
6194
- }
6195
- }
6196
- }
6197
- ]
6198
- },
6199
- {
6200
- "name": "onActiveChanged",
6201
- "deprecated": "Please use $(ref:tabs.onActivated).",
6202
- "unsupported": true,
6203
- "type": "function",
6204
- "description": "Fires when the selected tab in a window changes. Note that the tab's URL may not be set at the time this event fired, but you can listen to $(ref:tabs.onUpdated) events to be notified when a URL is set.",
6205
- "parameters": [
6206
- {
6207
- "type": "integer",
6208
- "name": "tabId",
6209
- "minimum": 0,
6210
- "description": "The ID of the tab that has become active."
6211
- },
6212
- {
6213
- "type": "object",
6214
- "name": "selectInfo",
6215
- "properties": {
6216
- "windowId": {
6217
- "type": "integer",
6218
- "minimum": 0,
6219
- "description": "The ID of the window the selected tab changed inside of."
6220
- }
6221
- }
6222
- }
6223
- ]
6224
- },
6225
6071
  {
6226
6072
  "name": "onActivated",
6227
6073
  "type": "function",
@@ -6251,34 +6097,6 @@
6251
6097
  }
6252
6098
  ]
6253
6099
  },
6254
- {
6255
- "name": "onHighlightChanged",
6256
- "deprecated": "Please use $(ref:tabs.onHighlighted).",
6257
- "unsupported": true,
6258
- "type": "function",
6259
- "description": "Fired when the highlighted or selected tabs in a window changes.",
6260
- "parameters": [
6261
- {
6262
- "type": "object",
6263
- "name": "selectInfo",
6264
- "properties": {
6265
- "windowId": {
6266
- "type": "integer",
6267
- "minimum": 0,
6268
- "description": "The window whose tabs changed."
6269
- },
6270
- "tabIds": {
6271
- "type": "array",
6272
- "items": {
6273
- "type": "integer",
6274
- "minimum": 0
6275
- },
6276
- "description": "All highlighted tabs in the window."
6277
- }
6278
- }
6279
- }
6280
- ]
6281
- },
6282
6100
  {
6283
6101
  "name": "onHighlighted",
6284
6102
  "type": "function",
@@ -8982,6 +8800,7 @@
8982
8800
  "content_scripts.json": [
8983
8801
  {
8984
8802
  "namespace": "contentScripts",
8803
+ "max_manifest_version": 2,
8985
8804
  "types": [
8986
8805
  {
8987
8806
  "id": "RegisteredContentScriptOptions",
@@ -11331,7 +11150,6 @@
11331
11150
  {
11332
11151
  "name": "getBackgroundPage",
11333
11152
  "type": "function",
11334
- "max_manifest_version": 2,
11335
11153
  "description": "Returns the JavaScript 'window' object for the background page running inside the current extension. Returns null if the extension has no background page.",
11336
11154
  "parameters": [],
11337
11155
  "returns": {
@@ -15951,6 +15769,11 @@
15951
15769
  "world": {
15952
15770
  "$ref": "ExecutionWorld",
15953
15771
  "optional": true
15772
+ },
15773
+ "injectImmediately": {
15774
+ "type": "boolean",
15775
+ "optional": true,
15776
+ "description": "Whether the injection should be triggered in the target as soon as possible (but not necessarily prior to page load)."
15954
15777
  }
15955
15778
  }
15956
15779
  },
@@ -16479,6 +16302,23 @@
16479
16302
  }
16480
16303
  ]
16481
16304
  }
16305
+ ],
16306
+ "events": [
16307
+ {
16308
+ "name": "onChanged",
16309
+ "type": "function",
16310
+ "description": "Fired when one or more items change.",
16311
+ "parameters": [
16312
+ {
16313
+ "name": "changes",
16314
+ "type": "object",
16315
+ "additionalProperties": {
16316
+ "$ref": "StorageChange"
16317
+ },
16318
+ "description": "Object mapping each key that changed to its corresponding $(ref:storage.StorageChange) for that item."
16319
+ }
16320
+ ]
16321
+ }
16482
16322
  ]
16483
16323
  },
16484
16324
  {
@@ -16635,6 +16475,23 @@
16635
16475
  }
16636
16476
  ]
16637
16477
  }
16478
+ ],
16479
+ "events": [
16480
+ {
16481
+ "name": "onChanged",
16482
+ "type": "function",
16483
+ "description": "Fired when one or more items change.",
16484
+ "parameters": [
16485
+ {
16486
+ "name": "changes",
16487
+ "type": "object",
16488
+ "additionalProperties": {
16489
+ "$ref": "StorageChange"
16490
+ },
16491
+ "description": "Object mapping each key that changed to its corresponding $(ref:storage.StorageChange) for that item."
16492
+ }
16493
+ ]
16494
+ }
16638
16495
  ]
16639
16496
  }
16640
16497
  ],
@@ -18210,6 +18067,7 @@
18210
18067
  "properties": {
18211
18068
  "user_scripts": {
18212
18069
  "type": "object",
18070
+ "max_manifest_version": 2,
18213
18071
  "optional": true,
18214
18072
  "properties": {
18215
18073
  "api_script": {
@@ -18227,6 +18085,7 @@
18227
18085
  },
18228
18086
  {
18229
18087
  "namespace": "userScripts",
18088
+ "max_manifest_version": 2,
18230
18089
  "permissions": [
18231
18090
  "manifest:user_scripts"
18232
18091
  ],
@@ -18350,6 +18209,7 @@
18350
18209
  "user_scripts_content.json": [
18351
18210
  {
18352
18211
  "namespace": "userScripts",
18212
+ "max_manifest_version": 2,
18353
18213
  "permissions": [
18354
18214
  "manifest:user_scripts"
18355
18215
  ],
@@ -14865,7 +14865,8 @@
14865
14865
  "type": "boolean",
14866
14866
  "optional": true,
14867
14867
  "default": false,
14868
- "description": "Whether to create all cookies as nonPersistent (i.e., session) cookies."
14868
+ "description": "Whether to create all cookies as nonPersistent (i.e., session) cookies.",
14869
+ "deprecated": "This property has no effect anymore and its value is always <code>false<code>."
14869
14870
  }
14870
14871
  }
14871
14872
  }
@@ -15720,8 +15721,7 @@
15720
15721
  "type": "string",
15721
15722
  "enum": [
15722
15723
  "scripting"
15723
- ],
15724
- "min_manifest_version": 3
15724
+ ]
15725
15725
  }
15726
15726
  ]
15727
15727
  }
@@ -15733,7 +15733,6 @@
15733
15733
  "permissions": [
15734
15734
  "scripting"
15735
15735
  ],
15736
- "min_manifest_version": 3,
15737
15736
  "types": [
15738
15737
  {
15739
15738
  "id": "ScriptInjection",
@@ -15769,6 +15768,11 @@
15769
15768
  "world": {
15770
15769
  "$ref": "ExecutionWorld",
15771
15770
  "optional": true
15771
+ },
15772
+ "injectImmediately": {
15773
+ "type": "boolean",
15774
+ "optional": true,
15775
+ "description": "Whether the injection should be triggered in the target as soon as possible (but not necessarily prior to page load)."
15772
15776
  }
15773
15777
  }
15774
15778
  },
@@ -2483,7 +2483,7 @@
2483
2483
  "icons_attention": {
2484
2484
  "$ref": "ThemeColor",
2485
2485
  "optional": true,
2486
- "description": "The color of the toolbar icons in attention state such as the chat icon whith new messages."
2486
+ "description": "The color of the toolbar icons in attention state such as the chat icon with new messages."
2487
2487
  },
2488
2488
  "button_background_hover": {
2489
2489
  "$ref": "ThemeColor",
@@ -2873,7 +2873,7 @@
2873
2873
  {
2874
2874
  "name": "list",
2875
2875
  "type": "function",
2876
- "description": "Returns all mail accounts.",
2876
+ "description": "Returns all mail accounts. They will be returned in the same order as used in Thunderbird's folder pane.",
2877
2877
  "async": "callback",
2878
2878
  "parameters": [
2879
2879
  {
@@ -5359,6 +5359,41 @@
5359
5359
  "$ref": "ComposeRecipientList",
5360
5360
  "optional": true
5361
5361
  },
5362
+ "overrideDefaultFcc": {
5363
+ "type": "boolean",
5364
+ "optional": true,
5365
+ "description": "Indicates whether the default fcc setting (defined by the used identity) is being overridden for this message. Setting ``false`` will clear the override. Setting ``true`` will throw an exception, if ``overrideDefaultFccFolder`` is not set as well."
5366
+ },
5367
+ "overrideDefaultFccFolder": {
5368
+ "choices": [
5369
+ {
5370
+ "$ref": "folders.MailFolder"
5371
+ },
5372
+ {
5373
+ "type": "string",
5374
+ "enum": [
5375
+ ""
5376
+ ]
5377
+ }
5378
+ ],
5379
+ "optional": true,
5380
+ "description": " This value overrides the default fcc setting (defined by the used identity) for this message only. Either a :ref:`folders.MailFolder` specifying the folder for the copy of the sent message, or ``\"\"`` to not save a copy at all."
5381
+ },
5382
+ "additionalFccFolder": {
5383
+ "choices": [
5384
+ {
5385
+ "$ref": "folders.MailFolder"
5386
+ },
5387
+ {
5388
+ "type": "string",
5389
+ "enum": [
5390
+ ""
5391
+ ]
5392
+ }
5393
+ ],
5394
+ "description": "An additional fcc folder which can be selected while composing the message, ``\"\"`` if not used.",
5395
+ "optional": true
5396
+ },
5362
5397
  "replyTo": {
5363
5398
  "$ref": "ComposeRecipientList",
5364
5399
  "optional": true
@@ -5419,14 +5454,52 @@
5419
5454
  "description": "Whether the message is an HTML message or a plain text message.",
5420
5455
  "optional": true
5421
5456
  },
5457
+ "deliveryFormat": {
5458
+ "type": "string",
5459
+ "enum": [
5460
+ "auto",
5461
+ "plaintext",
5462
+ "html",
5463
+ "both"
5464
+ ],
5465
+ "description": "Defines the mime format of the send message (ignored on plain text messages). Defaults to ``auto``, which will send html messages as plain text, if they do not include any formatting, and as ``both`` otherwise (a multipart/mixed message).",
5466
+ "optional": true
5467
+ },
5422
5468
  "customHeaders": {
5423
5469
  "type": "array",
5424
5470
  "items": {
5425
5471
  "$ref": "CustomHeader"
5426
5472
  },
5427
- "description": "Array of custom headers. Headers will be returned in ``Http-Header-Case`` (a.k.a. ``Train-Case``)",
5473
+ "description": "Array of custom headers. Headers will be returned in ``Http-Header-Case`` (a.k.a. ``Train-Case``). Set an empty array to clear all custom headers.",
5474
+ "optional": true
5475
+ },
5476
+ "priority": {
5477
+ "type": "string",
5478
+ "enum": [
5479
+ "lowest",
5480
+ "low",
5481
+ "normal",
5482
+ "high",
5483
+ "highest"
5484
+ ],
5485
+ "description": "The priority of the message.",
5428
5486
  "optional": true
5429
5487
  },
5488
+ "returnReceipt": {
5489
+ "type": "boolean",
5490
+ "optional": true,
5491
+ "description": "Add the ``Disposition-Notification-To`` header to the message to requests the recipients email client to send a reply once the message has been received. Recipient server may strip the header and the recipient might ignore the request."
5492
+ },
5493
+ "deliveryStatusNotification": {
5494
+ "type": "boolean",
5495
+ "optional": true,
5496
+ "description": "Let the sender know when the recipient's server received the message. Not supported by all servers."
5497
+ },
5498
+ "attachVCard": {
5499
+ "type": "boolean",
5500
+ "optional": true,
5501
+ "description": "Wether or not the vCard of the used identity will be attached to the message during send. Note: If the value has not been modified, selecting a different identity will load the default value of the new identity."
5502
+ },
5430
5503
  "attachments": {
5431
5504
  "type": "array",
5432
5505
  "items": {
@@ -6715,7 +6788,7 @@
6715
6788
  },
6716
6789
  "subFolders": {
6717
6790
  "type": "array",
6718
- "description": "Subfolders are only included if requested.",
6791
+ "description": "Subfolders are only included if requested. They will be returned in the same order as used in Thunderbird's folder pane.",
6719
6792
  "items": {
6720
6793
  "$ref": "MailFolder"
6721
6794
  },
@@ -9285,7 +9358,8 @@
9285
9358
  "enum": [
9286
9359
  "messagesMove",
9287
9360
  "messagesRead",
9288
- "messagesDelete"
9361
+ "messagesDelete",
9362
+ "messagesTags"
9289
9363
  ]
9290
9364
  }
9291
9365
  ]
@@ -9334,6 +9408,10 @@
9334
9408
  "type": "string",
9335
9409
  "description": "The message-id header of the message."
9336
9410
  },
9411
+ "headersOnly": {
9412
+ "description": "Some account types (for example POP) allow to download only the headers of the message, but not its body. The body of such messages will not be available.",
9413
+ "type": "boolean"
9414
+ },
9337
9415
  "id": {
9338
9416
  "type": "integer",
9339
9417
  "minimum": 1
@@ -9695,7 +9773,7 @@
9695
9773
  {
9696
9774
  "name": "getFull",
9697
9775
  "type": "function",
9698
- "description": "Returns a specified message, including all headers and MIME parts.",
9776
+ "description": "Returns a specified message, including all headers and MIME parts. Throws if the message could not be read, for example due to network issues.",
9699
9777
  "async": "callback",
9700
9778
  "parameters": [
9701
9779
  {
@@ -9717,7 +9795,7 @@
9717
9795
  {
9718
9796
  "name": "getRaw",
9719
9797
  "type": "function",
9720
- "description": "Returns the unmodified source of a message as a `binary string <https://developer.mozilla.org/en-US/docs/Web/API/DOMString/Binary>`__, which is a simple series of 8-bit values. If the message contains non-ASCII characters, the body parts in the binary string cannot be read directly and must be decoded according to their character sets. Use :ref:`messages.getFull` to get the correctly decoded parts. Manually decoding the raw message is probably too error-prone, especially if the message contains MIME parts with different character set encodings or attachments.\n\nTo get a readable version of the raw message as it appears in Thunderbird's message source view, it may be sufficient to decode the message according to the character set specified in its main ``content-type`` header (example: `text/html; charset=UTF-8`) using the following function (see MDN for `supported input encodings <https://developer.mozilla.org/en-US/docs/Web/API/Encoding_API/Encodings>`__): <literalinclude>includes/messages/decodeBinaryString.js<lang>JavaScript</lang></literalinclude>",
9798
+ "description": "Returns the unmodified source of a message as a `binary string <https://developer.mozilla.org/en-US/docs/Web/API/DOMString/Binary>`__, which is a simple series of 8-bit values. Throws if the message could not be read, for example due to network issues. If the message contains non-ASCII characters, the body parts in the binary string cannot be read directly and must be decoded according to their character sets. Use :ref:`messages.getFull` to get the correctly decoded parts. Manually decoding the raw message is probably too error-prone, especially if the message contains MIME parts with different character set encodings or attachments.\n\nTo get a readable version of the raw message as it appears in Thunderbird's message source view, it may be sufficient to decode the message according to the character set specified in its main ``content-type`` header (example: `text/html; charset=UTF-8`) using the following function (see MDN for `supported input encodings <https://developer.mozilla.org/en-US/docs/Web/API/Encoding_API/Encodings>`__): <literalinclude>includes/messages/decodeBinaryString.js<lang>JavaScript</lang></literalinclude>",
9721
9799
  "async": "callback",
9722
9800
  "parameters": [
9723
9801
  {
@@ -10029,6 +10107,78 @@
10029
10107
  ]
10030
10108
  }
10031
10109
  ]
10110
+ },
10111
+ {
10112
+ "name": "createTag",
10113
+ "type": "function",
10114
+ "description": "Creates a new message tag. Tagging a message will store the tag's key in the user's message.",
10115
+ "async": true,
10116
+ "permissions": [
10117
+ "messagesTags"
10118
+ ],
10119
+ "parameters": [
10120
+ {
10121
+ "type": "string",
10122
+ "name": "key",
10123
+ "pattern": "^[$a-zA-Z0-9]+$"
10124
+ },
10125
+ {
10126
+ "type": "string",
10127
+ "name": "tag"
10128
+ },
10129
+ {
10130
+ "type": "string",
10131
+ "name": "color",
10132
+ "pattern": "^#[0-9a-f]{6}"
10133
+ }
10134
+ ]
10135
+ },
10136
+ {
10137
+ "name": "updateTag",
10138
+ "type": "function",
10139
+ "description": "Updates a message tag.",
10140
+ "async": true,
10141
+ "permissions": [
10142
+ "messagesTags"
10143
+ ],
10144
+ "parameters": [
10145
+ {
10146
+ "type": "string",
10147
+ "name": "key",
10148
+ "pattern": "^[$a-zA-Z0-9]+$"
10149
+ },
10150
+ {
10151
+ "type": "object",
10152
+ "name": "updateProperties",
10153
+ "properties": {
10154
+ "tag": {
10155
+ "type": "string",
10156
+ "optional": "true"
10157
+ },
10158
+ "color": {
10159
+ "type": "string",
10160
+ "pattern": "^#[0-9a-f]{6}",
10161
+ "optional": "true"
10162
+ }
10163
+ }
10164
+ }
10165
+ ]
10166
+ },
10167
+ {
10168
+ "name": "deleteTag",
10169
+ "type": "function",
10170
+ "description": "Deletes a message tag, removing it from the list of known tags. Its key will not be removed from tagged messages, but they will appear untagged. Recreating a deleted tag, will make all former tagged messages appear tagged again.",
10171
+ "async": true,
10172
+ "permissions": [
10173
+ "messagesTags"
10174
+ ],
10175
+ "parameters": [
10176
+ {
10177
+ "type": "string",
10178
+ "name": "key",
10179
+ "pattern": "^[$a-zA-Z0-9]+$"
10180
+ }
10181
+ ]
10032
10182
  }
10033
10183
  ]
10034
10184
  }
@@ -5000,6 +5000,11 @@
5000
5000
  "type": "string",
5001
5001
  "optional": true,
5002
5002
  "description": "The title used for display if the tab is created in discarded mode."
5003
+ },
5004
+ "muted": {
5005
+ "type": "boolean",
5006
+ "optional": true,
5007
+ "description": "Whether the tab should be muted when created."
5003
5008
  }
5004
5009
  }
5005
5010
  },
@@ -13018,6 +13023,11 @@
13018
13023
  }
13019
13024
  ]
13020
13025
  },
13026
+ "granted_host_permissions": {
13027
+ "type": "boolean",
13028
+ "optional": true,
13029
+ "default": false
13030
+ },
13021
13031
  "host_permissions": {
13022
13032
  "min_manifest_version": 3,
13023
13033
  "type": "array",
@@ -14493,9 +14503,6 @@
14493
14503
  "permissions.json": [
14494
14504
  {
14495
14505
  "namespace": "permissions",
14496
- "permissions": [
14497
- "manifest:optional_permissions"
14498
- ],
14499
14506
  "types": [
14500
14507
  {
14501
14508
  "id": "Permissions",
@@ -15337,7 +15344,6 @@
15337
15344
  "functions": [
15338
15345
  {
15339
15346
  "name": "getBackgroundPage",
15340
- "max_manifest_version": 2,
15341
15347
  "type": "function",
15342
15348
  "description": "Retrieves the JavaScript 'window' object for the background page running inside the current extension/app. If the background page is an event page, the system will ensure it is loaded before calling the callback. If there is no background page, an error is set.",
15343
15349
  "async": "callback",
@@ -15748,13 +15754,11 @@
15748
15754
  },
15749
15755
  {
15750
15756
  "name": "onSuspend",
15751
- "unsupported": true,
15752
15757
  "type": "function",
15753
15758
  "description": "Sent to the event page just before it is unloaded. This gives the extension opportunity to do some clean up. Note that since the page is unloading, any asynchronous operations started while handling this event are not guaranteed to complete. If more activity for the event page occurs before it gets unloaded the onSuspendCanceled event will be sent and the page won't be unloaded. "
15754
15759
  },
15755
15760
  {
15756
15761
  "name": "onSuspendCanceled",
15757
- "unsupported": true,
15758
15762
  "type": "function",
15759
15763
  "description": "Sent after onSuspend to indicate that the app won't be unloaded after all."
15760
15764
  },
@@ -15943,6 +15947,10 @@
15943
15947
  "target": {
15944
15948
  "$ref": "InjectionTarget",
15945
15949
  "description": "Details specifying the target into which to inject the script."
15950
+ },
15951
+ "world": {
15952
+ "$ref": "ExecutionWorld",
15953
+ "optional": true
15946
15954
  }
15947
15955
  }
15948
15956
  },
@@ -16044,6 +16052,14 @@
16044
16052
  }
16045
16053
  }
16046
16054
  },
16055
+ {
16056
+ "id": "ExecutionWorld",
16057
+ "type": "string",
16058
+ "enum": [
16059
+ "ISOLATED"
16060
+ ],
16061
+ "description": "The JavaScript world for a script to execute within. We currently only support the <code>'ISOLATED'</code> world."
16062
+ },
16047
16063
  {
16048
16064
  "id": "RegisteredContentScript",
16049
16065
  "type": "object",
@@ -16084,8 +16100,22 @@
16084
16100
  "runAt": {
16085
16101
  "$ref": "extensionTypes.RunAt",
16086
16102
  "optional": true,
16087
- "default": "document_idle",
16088
16103
  "description": "Specifies when JavaScript files are injected into the web page. The preferred and default value is <code>document_idle</code>."
16104
+ },
16105
+ "persistAcrossSessions": {
16106
+ "type": "boolean",
16107
+ "enum": [
16108
+ false
16109
+ ],
16110
+ "description": "Specifies if this content script will persist into future sessions. This is currently NOT supported."
16111
+ },
16112
+ "css": {
16113
+ "type": "array",
16114
+ "optional": true,
16115
+ "description": "The list of CSS files to be injected into matching pages. These are injected in the order they appear in this array.",
16116
+ "items": {
16117
+ "$ref": "manifest.ExtensionURL"
16118
+ }
16089
16119
  }
16090
16120
  }
16091
16121
  }
@@ -16225,6 +16255,39 @@
16225
16255
  "parameters": []
16226
16256
  }
16227
16257
  ]
16258
+ },
16259
+ {
16260
+ "name": "updateContentScripts",
16261
+ "type": "function",
16262
+ "description": "Updates one or more content scripts for this extension.",
16263
+ "async": "callback",
16264
+ "parameters": [
16265
+ {
16266
+ "name": "scripts",
16267
+ "type": "array",
16268
+ "description": "Contains a list of scripts to be updated. If there are errors during script parsing/file validation, or if the IDs specified do not already exist, then no scripts are updated.",
16269
+ "items": {
16270
+ "type": "object",
16271
+ "$import": "RegisteredContentScript",
16272
+ "properties": {
16273
+ "persistAcrossSessions": {
16274
+ "type": "boolean",
16275
+ "optional": true,
16276
+ "enum": [
16277
+ false
16278
+ ],
16279
+ "description": "Specifies if this content script will persist into future sessions. This is currently NOT supported."
16280
+ }
16281
+ }
16282
+ }
16283
+ },
16284
+ {
16285
+ "name": "callback",
16286
+ "type": "function",
16287
+ "description": "Invoked when scripts have been updated.",
16288
+ "parameters": []
16289
+ }
16290
+ ]
16228
16291
  }
16229
16292
  ]
16230
16293
  }
@@ -17804,6 +17867,26 @@
17804
17867
  },
17805
17868
  "maxItems": 15,
17806
17869
  "optional": true
17870
+ },
17871
+ "color_scheme": {
17872
+ "optional": true,
17873
+ "type": "string",
17874
+ "enum": [
17875
+ "auto",
17876
+ "light",
17877
+ "dark",
17878
+ "system"
17879
+ ]
17880
+ },
17881
+ "content_color_scheme": {
17882
+ "optional": true,
17883
+ "type": "string",
17884
+ "enum": [
17885
+ "auto",
17886
+ "light",
17887
+ "dark",
17888
+ "system"
17889
+ ]
17807
17890
  }
17808
17891
  },
17809
17892
  "additionalProperties": {