webext-schema 2.0.6 → 2.0.7

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/package.json CHANGED
@@ -27,7 +27,7 @@
27
27
  "commander": "^8.3.0",
28
28
  "decamelize": "^6.0.0",
29
29
  "json5": "^2.2.0",
30
- "node-fetch": "^3.1.0",
30
+ "node-fetch": "^3.2.0",
31
31
  "sinon": "^12.0.1"
32
32
  },
33
33
  "devDependencies": {
@@ -36,11 +36,11 @@
36
36
  "eslint": "^7.32.0",
37
37
  "eslint-config-standard": "^16.0.3",
38
38
  "eslint-plugin-import": "^2.25.4",
39
- "eslint-plugin-jsdoc": "^37.6.1",
39
+ "eslint-plugin-jsdoc": "^37.6.3",
40
40
  "eslint-plugin-node": "^11.1.0",
41
41
  "eslint-plugin-promise": "^5.2.0",
42
- "mocha": "^9.1.3",
43
- "nock": "^13.2.1"
42
+ "mocha": "^9.2.0",
43
+ "nock": "^13.2.2"
44
44
  },
45
- "version": "2.0.6"
45
+ "version": "2.0.7"
46
46
  }
@@ -11776,6 +11776,7 @@
11776
11776
  "samplingallthreads",
11777
11777
  "markersallthreads",
11778
11778
  "unregisteredthreads",
11779
+ "processcpu",
11779
11780
  "responsiveness"
11780
11781
  ]
11781
11782
  },
@@ -15941,7 +15942,7 @@
15941
15942
  "files": {
15942
15943
  "type": "array",
15943
15944
  "optional": true,
15944
- "description": "The path of the JS or CSS files to inject, relative to the extension's root directory. Exactly one of <code>files</code> and <code>func</code> must be specified.",
15945
+ "description": "The path of the JS files to inject, relative to the extension's root directory. Exactly one of <code>files</code> and <code>func</code> must be specified.",
15945
15946
  "minItems": 1,
15946
15947
  "items": {
15947
15948
  "type": "string"
@@ -15964,13 +15965,24 @@
15964
15965
  "description": "Result of a script injection.",
15965
15966
  "properties": {
15966
15967
  "frameId": {
15967
- "type": "number",
15968
+ "type": "integer",
15968
15969
  "description": "The frame ID associated with the injection."
15969
15970
  },
15970
15971
  "result": {
15971
15972
  "type": "any",
15972
15973
  "optional": true,
15973
15974
  "description": "The result of the script execution."
15975
+ },
15976
+ "error": {
15977
+ "type": "object",
15978
+ "optional": true,
15979
+ "description": "When the injection has failed, the error is exposed to the caller with this property.",
15980
+ "properties": {
15981
+ "message": {
15982
+ "type": "string",
15983
+ "description": "A message explaining why the injection has failed."
15984
+ }
15985
+ }
15974
15986
  }
15975
15987
  }
15976
15988
  },
@@ -15986,11 +15998,50 @@
15986
15998
  "type": "number"
15987
15999
  }
15988
16000
  },
16001
+ "allFrames": {
16002
+ "type": "boolean",
16003
+ "optional": true,
16004
+ "description": "Whether the script should inject into all frames within the tab. Defaults to false. This must not be true if <code>frameIds</code> is specified."
16005
+ },
15989
16006
  "tabId": {
15990
16007
  "type": "number",
15991
16008
  "description": "The ID of the tab into which to inject."
15992
16009
  }
15993
16010
  }
16011
+ },
16012
+ {
16013
+ "id": "CSSInjection",
16014
+ "type": "object",
16015
+ "properties": {
16016
+ "css": {
16017
+ "type": "string",
16018
+ "optional": true,
16019
+ "description": "A string containing the CSS to inject. Exactly one of <code>files</code> and <code>css</code> must be specified."
16020
+ },
16021
+ "files": {
16022
+ "type": "array",
16023
+ "optional": true,
16024
+ "description": "The path of the CSS files to inject, relative to the extension's root directory. Exactly one of <code>files</code> and <code>css</code> must be specified.",
16025
+ "minItems": 1,
16026
+ "items": {
16027
+ "type": "string"
16028
+ }
16029
+ },
16030
+ "origin": {
16031
+ "type": "string",
16032
+ "optional": true,
16033
+ "enum": [
16034
+ "USER",
16035
+ "AUTHOR"
16036
+ ],
16037
+ "default": "AUTHOR",
16038
+ "description": "The style origin for the injection. Defaults to <code>'AUTHOR'</code>."
16039
+ },
16040
+ "target": {
16041
+ "$ref": "InjectionTarget",
16042
+ "description": "Details specifying the target into which to inject the CSS."
16043
+ }
16044
+ }
15994
16045
  }
15995
16046
  ],
15996
16047
  "functions": [
@@ -16020,6 +16071,44 @@
16020
16071
  ]
16021
16072
  }
16022
16073
  ]
16074
+ },
16075
+ {
16076
+ "name": "insertCSS",
16077
+ "type": "function",
16078
+ "description": "Inserts a CSS stylesheet into a target context. If multiple frames are specified, unsuccessful injections are ignored.",
16079
+ "async": "callback",
16080
+ "parameters": [
16081
+ {
16082
+ "name": "injection",
16083
+ "$ref": "CSSInjection",
16084
+ "description": "The details of the styles to insert."
16085
+ },
16086
+ {
16087
+ "name": "callback",
16088
+ "type": "function",
16089
+ "description": "Invoked upon completion of the injection.",
16090
+ "parameters": []
16091
+ }
16092
+ ]
16093
+ },
16094
+ {
16095
+ "name": "removeCSS",
16096
+ "type": "function",
16097
+ "description": "Removes a CSS stylesheet that was previously inserted by this extension from a target context.",
16098
+ "async": "callback",
16099
+ "parameters": [
16100
+ {
16101
+ "name": "injection",
16102
+ "$ref": "CSSInjection",
16103
+ "description": "The details of the styles to remove. Note that the <code>css</code>, <code>files</code>, and <code>origin</code> properties must exactly match the stylesheet inserted through <code>insertCSS</code>. Attempting to remove a non-existent stylesheet is a no-op."
16104
+ },
16105
+ {
16106
+ "name": "callback",
16107
+ "type": "function",
16108
+ "description": "Invoked upon completion of the injection.",
16109
+ "parameters": []
16110
+ }
16111
+ ]
16023
16112
  }
16024
16113
  ]
16025
16114
  }
@@ -18009,6 +18098,22 @@
18009
18098
  "default": "document_idle",
18010
18099
  "optional": true,
18011
18100
  "description": "The soonest that the JavaScript will be injected into the tab. Defaults to \"document_idle\"."
18101
+ },
18102
+ "cookieStoreId": {
18103
+ "choices": [
18104
+ {
18105
+ "type": "array",
18106
+ "minItems": 1,
18107
+ "items": {
18108
+ "type": "string"
18109
+ }
18110
+ },
18111
+ {
18112
+ "type": "string"
18113
+ }
18114
+ ],
18115
+ "optional": true,
18116
+ "description": "limit the set of matched tabs to those that belong to the given cookie store id"
18012
18117
  }
18013
18118
  }
18014
18119
  },
@@ -4824,7 +4824,7 @@
4824
4824
  {
4825
4825
  "name": "onFileRename",
4826
4826
  "type": "function",
4827
- "description": "Fired when an already uploaded file should be renamed.",
4827
+ "description": "Fired when a previously uploaded file should be renamed.",
4828
4828
  "parameters": [
4829
4829
  {
4830
4830
  "name": "account",
@@ -4874,7 +4874,7 @@
4874
4874
  {
4875
4875
  "name": "onFileDeleted",
4876
4876
  "type": "function",
4877
- "description": "Fired when a file previously uploaded should be deleted.",
4877
+ "description": "Fired when a previously uploaded file should be deleted.",
4878
4878
  "parameters": [
4879
4879
  {
4880
4880
  "name": "account",
@@ -5247,7 +5247,7 @@
5247
5247
  },
5248
5248
  "from": {
5249
5249
  "$ref": "ComposeRecipient",
5250
- "description": "*Caution*: Setting a value for `from` does not change the used identity, it overrides the FROM header. Many email servers do not accept emails where the FROM header does not match the sender identity. Must be set to exactly one valid email address.",
5250
+ "description": "*Caution*: Setting a value for ``from`` does not change the used identity, it overrides the FROM header. Many email servers do not accept emails where the FROM header does not match the sender identity. Must be set to exactly one valid email address.",
5251
5251
  "optional": true
5252
5252
  },
5253
5253
  "to": {
@@ -5309,38 +5309,55 @@
5309
5309
  },
5310
5310
  "body": {
5311
5311
  "type": "string",
5312
+ "description": "The HTML content of the message. Ignored by ``setComposeDetails``, if used on a plain text composer. If only ``body`` is specified when used with ``beginNew``, ``beginReply`` and similar functions, an HTML message will be created. The recommended usage is to always specify both (``body`` and ``plainTextBody``) and use ``isPlainText`` to select the compose format, or use the users default compose format.",
5312
5313
  "optional": true
5313
5314
  },
5314
5315
  "plainTextBody": {
5315
5316
  "type": "string",
5317
+ "description": "The plain text content of the message. Ignored by ``setComposeDetails``, if used on an HTML composer. If only ``plainTextBody`` is specified when used with ``beginNew``, ``beginReply`` and similar functions, a plain text message will be created. The recommended usage is to always specify both (``body`` and ``plainTextBody``) and use ``isPlainText`` to select the compose format, or use the users default compose format.",
5316
5318
  "optional": true
5317
5319
  },
5318
5320
  "isPlainText": {
5319
5321
  "type": "boolean",
5322
+ "description": "Wether the message is an HTML message or a plain text message. Can be used to specify the message format in ``beginNew``, ``beginReply`` and similar functions. It is however not possible to change the compose format with ``setComposeDetails``. Note: Using ``isPlainText`` together with a single but conflicting body type (e.g.: ``isPlainText`` = ``true`` and ``body`` is set but not ``plainTextBody``) will cause an exception. ",
5320
5323
  "optional": true
5321
5324
  },
5322
5325
  "attachments": {
5323
5326
  "type": "array",
5324
5327
  "items": {
5325
- "type": "object",
5326
- "properties": {
5327
- "name": {
5328
- "type": "string",
5329
- "description": "The name, as displayed to the user, of this attachment. If not specified, the name of the ``file`` object is used.",
5330
- "optional": true
5328
+ "choices": [
5329
+ {
5330
+ "$ref": "FileAttachment"
5331
5331
  },
5332
- "file": {
5333
- "type": "object",
5334
- "isInstanceOf": "File",
5335
- "additionalProperties": true
5332
+ {
5333
+ "$ref": "ComposeAttachment"
5336
5334
  }
5337
- }
5335
+ ]
5338
5336
  },
5339
5337
  "description": "Attachments to add to the message. Only used in the begin* functions.",
5340
5338
  "optional": true
5341
5339
  }
5342
5340
  }
5343
5341
  },
5342
+ {
5343
+ "id": "FileAttachment",
5344
+ "type": "object",
5345
+ "description": "Object used to add, update or rename an attachment in a message being composed.",
5346
+ "properties": {
5347
+ "file": {
5348
+ "type": "object",
5349
+ "isInstanceOf": "File",
5350
+ "additionalProperties": true,
5351
+ "description": "The new content for the attachment.",
5352
+ "optional": true
5353
+ },
5354
+ "name": {
5355
+ "type": "string",
5356
+ "description": "The new name for the attachment, as displayed to the user. If not specified, the name of the provided ``file`` object is used.",
5357
+ "optional": true
5358
+ }
5359
+ }
5360
+ },
5344
5361
  {
5345
5362
  "id": "ComposeAttachment",
5346
5363
  "type": "object",
@@ -5352,22 +5369,15 @@
5352
5369
  },
5353
5370
  "name": {
5354
5371
  "type": "string",
5355
- "description": "The name, as displayed to the user, of this attachment. This is usually but not always the filename of the attached file."
5372
+ "optional": true,
5373
+ "description": "The name of this attachment, as displayed to the user."
5356
5374
  },
5357
5375
  "size": {
5358
5376
  "type": "integer",
5359
- "description": "The size in bytes of this attachment."
5360
- }
5361
- },
5362
- "functions": [
5363
- {
5364
- "name": "getFile",
5365
- "type": "function",
5366
- "description": "Retrieves the contents of the attachment as a DOM ``File`` object.",
5367
- "async": true,
5368
- "parameters": []
5377
+ "optional": true,
5378
+ "description": "The size in bytes of this attachment. Read-only."
5369
5379
  }
5370
- ]
5380
+ }
5371
5381
  }
5372
5382
  ],
5373
5383
  "events": [
@@ -5652,17 +5662,35 @@
5652
5662
  "optional": true,
5653
5663
  "parameters": [
5654
5664
  {
5655
- "choices": [
5656
- {
5657
- "type": "array",
5658
- "items": {
5659
- "$ref": "ComposeAttachment"
5660
- }
5661
- },
5662
- {
5663
- "type": "any"
5664
- }
5665
- ]
5665
+ "type": "array",
5666
+ "items": {
5667
+ "$ref": "ComposeAttachment"
5668
+ }
5669
+ }
5670
+ ]
5671
+ }
5672
+ ]
5673
+ },
5674
+ {
5675
+ "name": "getAttachmentFile",
5676
+ "type": "function",
5677
+ "description": "Gets the content of a :ref:`compose.ComposeAttachment` as a DOM <code>File</code> object.",
5678
+ "async": "callback",
5679
+ "parameters": [
5680
+ {
5681
+ "name": "id",
5682
+ "type": "integer",
5683
+ "description": "The unique identifier for the attachment."
5684
+ },
5685
+ {
5686
+ "type": "function",
5687
+ "name": "callback",
5688
+ "optional": true,
5689
+ "parameters": [
5690
+ {
5691
+ "type": "object",
5692
+ "isInstanceOf": "File",
5693
+ "additionalProperties": true
5666
5694
  }
5667
5695
  ]
5668
5696
  }
@@ -5682,20 +5710,15 @@
5682
5710
  "type": "integer"
5683
5711
  },
5684
5712
  {
5685
- "name": "data",
5686
- "type": "object",
5687
- "properties": {
5688
- "name": {
5689
- "type": "string",
5690
- "description": "The name, as displayed to the user, of this attachment. If not specified, the name of the ``file`` object is used.",
5691
- "optional": true
5713
+ "name": "attachment",
5714
+ "choices": [
5715
+ {
5716
+ "$ref": "FileAttachment"
5692
5717
  },
5693
- "file": {
5694
- "type": "object",
5695
- "isInstanceOf": "File",
5696
- "additionalProperties": true
5718
+ {
5719
+ "$ref": "ComposeAttachment"
5697
5720
  }
5698
- }
5721
+ ]
5699
5722
  },
5700
5723
  {
5701
5724
  "type": "function",
@@ -5703,14 +5726,7 @@
5703
5726
  "optional": true,
5704
5727
  "parameters": [
5705
5728
  {
5706
- "choices": [
5707
- {
5708
- "$ref": "ComposeAttachment"
5709
- },
5710
- {
5711
- "type": "any"
5712
- }
5713
- ]
5729
+ "$ref": "ComposeAttachment"
5714
5730
  }
5715
5731
  ]
5716
5732
  }
@@ -5719,7 +5735,7 @@
5719
5735
  {
5720
5736
  "name": "updateAttachment",
5721
5737
  "type": "function",
5722
- "description": "Renames and/or replaces the contents of an attachment to the message being composed in the specified tab.",
5738
+ "description": "Updates the name and/or the content of an attachment in the message being composed in the specified tab. If the specified attachment is a cloud file attachment and the associated provider failed to update the attachment, the function will throw an ``ExtensionError``.",
5723
5739
  "permissions": [
5724
5740
  "compose"
5725
5741
  ],
@@ -5734,21 +5750,8 @@
5734
5750
  "type": "integer"
5735
5751
  },
5736
5752
  {
5737
- "name": "data",
5738
- "type": "object",
5739
- "properties": {
5740
- "name": {
5741
- "type": "string",
5742
- "description": "The name, as displayed to the user, of this attachment. If not specified, the name of the ``file`` object is used.",
5743
- "optional": true
5744
- },
5745
- "file": {
5746
- "type": "object",
5747
- "isInstanceOf": "File",
5748
- "additionalProperties": true,
5749
- "optional": true
5750
- }
5751
- }
5753
+ "name": "attachment",
5754
+ "$ref": "FileAttachment"
5752
5755
  },
5753
5756
  {
5754
5757
  "type": "function",
@@ -5756,14 +5759,7 @@
5756
5759
  "optional": true,
5757
5760
  "parameters": [
5758
5761
  {
5759
- "choices": [
5760
- {
5761
- "$ref": "ComposeAttachment"
5762
- },
5763
- {
5764
- "type": "any"
5765
- }
5766
- ]
5762
+ "$ref": "ComposeAttachment"
5767
5763
  }
5768
5764
  ]
5769
5765
  }
@@ -9365,7 +9361,7 @@
9365
9361
  }
9366
9362
  },
9367
9363
  {
9368
- "id": "Attachment",
9364
+ "id": "MessageAttachment",
9369
9365
  "type": "object",
9370
9366
  "description": "Represents an attachment in a message.",
9371
9367
  "properties": {
@@ -9605,7 +9601,7 @@
9605
9601
  {
9606
9602
  "type": "array",
9607
9603
  "items": {
9608
- "$ref": "Attachment"
9604
+ "$ref": "MessageAttachment"
9609
9605
  }
9610
9606
  }
9611
9607
  ]
@@ -9615,7 +9611,7 @@
9615
9611
  {
9616
9612
  "name": "getAttachmentFile",
9617
9613
  "type": "function",
9618
- "description": "Gets the content of an attachment as a DOM <code>File</code> object.",
9614
+ "description": "Gets the content of a :ref:`messages.MessageAttachment` as a DOM <code>File</code> object.",
9619
9615
  "async": "callback",
9620
9616
  "parameters": [
9621
9617
  {