webext-schema 2.2.0 → 2.3.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.
@@ -252,11 +252,13 @@ export const getEnabledTheme = async () => {
252
252
  let res;
253
253
  if (isGranted) {
254
254
  const { management } = browser;
255
- const arr = await management.getAll();
256
- if (Array.isArray(arr)) {
255
+ try {
256
+ const arr = await management.getAll();
257
257
  res = arr.filter(info =>
258
258
  info.type && info.type === 'theme' && info.enabled && info
259
259
  );
260
+ } catch (e) {
261
+ logErr(e);
260
262
  }
261
263
  }
262
264
  return res || null;
package/package.json CHANGED
@@ -29,24 +29,24 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "camelize": "^1.0.0",
32
- "commander": "^9.1.0",
32
+ "commander": "^9.2.0",
33
33
  "decamelize": "^6.0.0",
34
- "json5": "^2.2.0",
34
+ "json5": "^2.2.1",
35
35
  "node-fetch": "^3.2.3",
36
- "sinon": "^13.0.1"
36
+ "sinon": "^13.0.2"
37
37
  },
38
38
  "devDependencies": {
39
- "c8": "^7.11.0",
39
+ "c8": "^7.11.2",
40
40
  "chai": "^4.3.6",
41
- "eslint": "^7.32.0",
42
- "eslint-config-standard": "^16.0.3",
43
- "eslint-plugin-import": "^2.25.4",
44
- "eslint-plugin-jsdoc": "^37.9.7",
41
+ "eslint": "^8.14.0",
42
+ "eslint-config-standard": "^17.0.0",
43
+ "eslint-plugin-import": "^2.26.0",
44
+ "eslint-plugin-jsdoc": "^39.2.7",
45
45
  "eslint-plugin-node": "^11.1.0",
46
- "eslint-plugin-promise": "^5.2.0",
46
+ "eslint-plugin-promise": "^6.0.0",
47
47
  "mocha": "^9.2.2",
48
48
  "nock": "^13.2.4",
49
49
  "npm-run-all": "^4.1.5"
50
50
  },
51
- "version": "2.2.0"
51
+ "version": "2.3.0"
52
52
  }
@@ -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": {
@@ -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,
@@ -5000,6 +4902,11 @@
5000
4902
  "type": "string",
5001
4903
  "optional": true,
5002
4904
  "description": "The title used for display if the tab is created in discarded mode."
4905
+ },
4906
+ "muted": {
4907
+ "type": "boolean",
4908
+ "optional": true,
4909
+ "description": "Whether the tab should be muted when created."
5003
4910
  }
5004
4911
  }
5005
4912
  },
@@ -5314,13 +5221,6 @@
5314
5221
  "optional": true,
5315
5222
  "description": "Adds or removes the tab from the current selection."
5316
5223
  },
5317
- "selected": {
5318
- "unsupported": true,
5319
- "deprecated": "Please use <em>highlighted</em>.",
5320
- "type": "boolean",
5321
- "optional": true,
5322
- "description": "Whether the tab should be selected."
5323
- },
5324
5224
  "pinned": {
5325
5225
  "type": "boolean",
5326
5226
  "optional": true,
@@ -5634,6 +5534,7 @@
5634
5534
  {
5635
5535
  "name": "executeScript",
5636
5536
  "type": "function",
5537
+ "max_manifest_version": 2,
5637
5538
  "description": "Injects JavaScript code into a page. For details, see the $(topic:content_scripts)[programmatic injection] section of the content scripts doc.",
5638
5539
  "async": "callback",
5639
5540
  "parameters": [
@@ -5671,6 +5572,7 @@
5671
5572
  {
5672
5573
  "name": "insertCSS",
5673
5574
  "type": "function",
5575
+ "max_manifest_version": 2,
5674
5576
  "description": "Injects CSS into a page. For details, see the $(topic:content_scripts)[programmatic injection] section of the content scripts doc.",
5675
5577
  "async": "callback",
5676
5578
  "parameters": [
@@ -5698,6 +5600,7 @@
5698
5600
  {
5699
5601
  "name": "removeCSS",
5700
5602
  "type": "function",
5603
+ "max_manifest_version": 2,
5701
5604
  "description": "Removes injected CSS from a page. For details, see the $(topic:content_scripts)[programmatic injection] section of the content scripts doc.",
5702
5605
  "async": "callback",
5703
5606
  "parameters": [
@@ -6165,58 +6068,6 @@
6165
6068
  }
6166
6069
  ]
6167
6070
  },
6168
- {
6169
- "name": "onSelectionChanged",
6170
- "deprecated": "Please use $(ref:tabs.onActivated).",
6171
- "unsupported": true,
6172
- "type": "function",
6173
- "description": "Fires when the selected tab in a window changes.",
6174
- "parameters": [
6175
- {
6176
- "type": "integer",
6177
- "name": "tabId",
6178
- "minimum": 0,
6179
- "description": "The ID of the tab that has become active."
6180
- },
6181
- {
6182
- "type": "object",
6183
- "name": "selectInfo",
6184
- "properties": {
6185
- "windowId": {
6186
- "type": "integer",
6187
- "minimum": 0,
6188
- "description": "The ID of the window the selected tab changed inside of."
6189
- }
6190
- }
6191
- }
6192
- ]
6193
- },
6194
- {
6195
- "name": "onActiveChanged",
6196
- "deprecated": "Please use $(ref:tabs.onActivated).",
6197
- "unsupported": true,
6198
- "type": "function",
6199
- "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.",
6200
- "parameters": [
6201
- {
6202
- "type": "integer",
6203
- "name": "tabId",
6204
- "minimum": 0,
6205
- "description": "The ID of the tab that has become active."
6206
- },
6207
- {
6208
- "type": "object",
6209
- "name": "selectInfo",
6210
- "properties": {
6211
- "windowId": {
6212
- "type": "integer",
6213
- "minimum": 0,
6214
- "description": "The ID of the window the selected tab changed inside of."
6215
- }
6216
- }
6217
- }
6218
- ]
6219
- },
6220
6071
  {
6221
6072
  "name": "onActivated",
6222
6073
  "type": "function",
@@ -6246,34 +6097,6 @@
6246
6097
  }
6247
6098
  ]
6248
6099
  },
6249
- {
6250
- "name": "onHighlightChanged",
6251
- "deprecated": "Please use $(ref:tabs.onHighlighted).",
6252
- "unsupported": true,
6253
- "type": "function",
6254
- "description": "Fired when the highlighted or selected tabs in a window changes.",
6255
- "parameters": [
6256
- {
6257
- "type": "object",
6258
- "name": "selectInfo",
6259
- "properties": {
6260
- "windowId": {
6261
- "type": "integer",
6262
- "minimum": 0,
6263
- "description": "The window whose tabs changed."
6264
- },
6265
- "tabIds": {
6266
- "type": "array",
6267
- "items": {
6268
- "type": "integer",
6269
- "minimum": 0
6270
- },
6271
- "description": "All highlighted tabs in the window."
6272
- }
6273
- }
6274
- }
6275
- ]
6276
- },
6277
6100
  {
6278
6101
  "name": "onHighlighted",
6279
6102
  "type": "function",
@@ -8977,6 +8800,7 @@
8977
8800
  "content_scripts.json": [
8978
8801
  {
8979
8802
  "namespace": "contentScripts",
8803
+ "max_manifest_version": 2,
8980
8804
  "types": [
8981
8805
  {
8982
8806
  "id": "RegisteredContentScriptOptions",
@@ -11326,7 +11150,6 @@
11326
11150
  {
11327
11151
  "name": "getBackgroundPage",
11328
11152
  "type": "function",
11329
- "max_manifest_version": 2,
11330
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.",
11331
11154
  "parameters": [],
11332
11155
  "returns": {
@@ -15749,13 +15572,11 @@
15749
15572
  },
15750
15573
  {
15751
15574
  "name": "onSuspend",
15752
- "unsupported": true,
15753
15575
  "type": "function",
15754
15576
  "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. "
15755
15577
  },
15756
15578
  {
15757
15579
  "name": "onSuspendCanceled",
15758
- "unsupported": true,
15759
15580
  "type": "function",
15760
15581
  "description": "Sent after onSuspend to indicate that the app won't be unloaded after all."
15761
15582
  },
@@ -16476,6 +16297,23 @@
16476
16297
  }
16477
16298
  ]
16478
16299
  }
16300
+ ],
16301
+ "events": [
16302
+ {
16303
+ "name": "onChanged",
16304
+ "type": "function",
16305
+ "description": "Fired when one or more items change.",
16306
+ "parameters": [
16307
+ {
16308
+ "name": "changes",
16309
+ "type": "object",
16310
+ "additionalProperties": {
16311
+ "$ref": "StorageChange"
16312
+ },
16313
+ "description": "Object mapping each key that changed to its corresponding $(ref:storage.StorageChange) for that item."
16314
+ }
16315
+ ]
16316
+ }
16479
16317
  ]
16480
16318
  },
16481
16319
  {
@@ -16632,6 +16470,23 @@
16632
16470
  }
16633
16471
  ]
16634
16472
  }
16473
+ ],
16474
+ "events": [
16475
+ {
16476
+ "name": "onChanged",
16477
+ "type": "function",
16478
+ "description": "Fired when one or more items change.",
16479
+ "parameters": [
16480
+ {
16481
+ "name": "changes",
16482
+ "type": "object",
16483
+ "additionalProperties": {
16484
+ "$ref": "StorageChange"
16485
+ },
16486
+ "description": "Object mapping each key that changed to its corresponding $(ref:storage.StorageChange) for that item."
16487
+ }
16488
+ ]
16489
+ }
16635
16490
  ]
16636
16491
  }
16637
16492
  ],
@@ -18207,6 +18062,7 @@
18207
18062
  "properties": {
18208
18063
  "user_scripts": {
18209
18064
  "type": "object",
18065
+ "max_manifest_version": 2,
18210
18066
  "optional": true,
18211
18067
  "properties": {
18212
18068
  "api_script": {
@@ -18224,6 +18080,7 @@
18224
18080
  },
18225
18081
  {
18226
18082
  "namespace": "userScripts",
18083
+ "max_manifest_version": 2,
18227
18084
  "permissions": [
18228
18085
  "manifest:user_scripts"
18229
18086
  ],
@@ -18347,6 +18204,7 @@
18347
18204
  "user_scripts_content.json": [
18348
18205
  {
18349
18206
  "namespace": "userScripts",
18207
+ "max_manifest_version": 2,
18350
18208
  "permissions": [
18351
18209
  "manifest:user_scripts"
18352
18210
  ],
@@ -265,6 +265,7 @@
265
265
  "content_scripts.json": [
266
266
  {
267
267
  "namespace": "contentScripts",
268
+ "max_manifest_version": 2,
268
269
  "types": [
269
270
  {
270
271
  "id": "RegisteredContentScriptOptions",
@@ -642,7 +643,6 @@
642
643
  {
643
644
  "name": "getBackgroundPage",
644
645
  "type": "function",
645
- "max_manifest_version": 2,
646
646
  "description": "Returns the JavaScript 'window' object for the background page running inside the current extension. Returns null if the extension has no background page.",
647
647
  "parameters": [],
648
648
  "returns": {
@@ -2121,13 +2121,11 @@
2121
2121
  },
2122
2122
  {
2123
2123
  "name": "onSuspend",
2124
- "unsupported": true,
2125
2124
  "type": "function",
2126
2125
  "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. "
2127
2126
  },
2128
2127
  {
2129
2128
  "name": "onSuspendCanceled",
2130
- "unsupported": true,
2131
2129
  "type": "function",
2132
2130
  "description": "Sent after onSuspend to indicate that the app won't be unloaded after all."
2133
2131
  },
@@ -4769,12 +4767,8 @@
4769
4767
  "data_format": {
4770
4768
  "type": "string",
4771
4769
  "optional": true,
4772
- "default": "File",
4773
- "description": "Determines the format of the ``data`` argument in ``onFileUpload``. Support for ArrayBuffer will be removed in Thunderbird 102.",
4774
- "enum": [
4775
- "ArrayBuffer",
4776
- "File"
4777
- ]
4770
+ "deprecated": true,
4771
+ "description": "This property is no longer used. The only supported data format for the ``data`` argument in ``onFileUpload`` is `File <https://developer.mozilla.org/docs/Web/API/File>`__."
4778
4772
  },
4779
4773
  "reuse_uploads": {
4780
4774
  "description": "If a previously uploaded cloud file attachment is reused at a later time in a different message, Thunderbird may use the already known ``url`` and ``templateInfo`` values without triggering the registered :ref:`cloudFile.onFileUpload` listener again. Setting this option to false will always trigger the registered listener, providing the already known values through the ``relatedFileInfo`` parameter of the :ref:`cloudFile.onFileUpload` event, to let the provider decide how to handle these cases.",
@@ -4853,7 +4847,7 @@
4853
4847
  "properties": {
4854
4848
  "aborted": {
4855
4849
  "type": "boolean",
4856
- "description": "Set this to true if the file upload was aborted.",
4850
+ "description": "Set this to true if the file upload was aborted by the user and an :ref:`cloudFile.onFileUploadAbort` event has been received. No error message will be shown to the user.",
4857
4851
  "optional": true
4858
4852
  },
4859
4853
  "error": {
@@ -5108,20 +5102,10 @@
5108
5102
  "description": "Filename of the file to be transferred."
5109
5103
  },
5110
5104
  "data": {
5111
- "choices": [
5112
- {
5113
- "type": "object",
5114
- "isInstanceOf": "ArrayBuffer",
5115
- "additionalProperties": true,
5116
- "description": "Contents of the file to be transferred."
5117
- },
5118
- {
5119
- "type": "object",
5120
- "isInstanceOf": "File",
5121
- "additionalProperties": true,
5122
- "description": "Contents of the file to be transferred."
5123
- }
5124
- ]
5105
+ "type": "object",
5106
+ "isInstanceOf": "File",
5107
+ "additionalProperties": true,
5108
+ "description": "Contents of the file to be transferred."
5125
5109
  }
5126
5110
  }
5127
5111
  },
@@ -5435,6 +5419,14 @@
5435
5419
  "description": "Whether the message is an HTML message or a plain text message.",
5436
5420
  "optional": true
5437
5421
  },
5422
+ "customHeaders": {
5423
+ "type": "array",
5424
+ "items": {
5425
+ "$ref": "CustomHeader"
5426
+ },
5427
+ "description": "Array of custom headers. Headers will be returned in ``Http-Header-Case`` (a.k.a. ``Train-Case``)",
5428
+ "optional": true
5429
+ },
5438
5430
  "attachments": {
5439
5431
  "type": "array",
5440
5432
  "items": {
@@ -5491,6 +5483,21 @@
5491
5483
  "description": "The size in bytes of this attachment. Read-only."
5492
5484
  }
5493
5485
  }
5486
+ },
5487
+ {
5488
+ "id": "CustomHeader",
5489
+ "type": "object",
5490
+ "description": "A custom header definition.",
5491
+ "properties": {
5492
+ "name": {
5493
+ "type": "string",
5494
+ "description": "Name of a custom header, must have a ``X-`` prefix.",
5495
+ "pattern": "^X-.*$"
5496
+ },
5497
+ "value": {
5498
+ "type": "string"
5499
+ }
5500
+ }
5494
5501
  }
5495
5502
  ],
5496
5503
  "events": [
@@ -8649,7 +8656,7 @@
8649
8656
  {
8650
8657
  "name": "getDisplayedMessage",
8651
8658
  "type": "function",
8652
- "description": "Gets the currently displayed message in the specified tab. It returns null if no messages are displayed, or if multiple messages are displayed.",
8659
+ "description": "Gets the currently displayed message in the specified tab (even if the tab itself is currently not visible). It returns null if no messages are displayed, or if multiple messages are displayed.",
8653
8660
  "async": "callback",
8654
8661
  "parameters": [
8655
8662
  {
@@ -8679,7 +8686,7 @@
8679
8686
  {
8680
8687
  "name": "getDisplayedMessages",
8681
8688
  "type": "function",
8682
- "description": "Gets an array of the currently displayed messages in the specified tab. The array is empty if no messages are displayed.",
8689
+ "description": "Gets an array of the currently displayed messages in the specified tab (even if the tab itself is currently not visible). The array is empty if no messages are displayed.",
8683
8690
  "async": "callback",
8684
8691
  "parameters": [
8685
8692
  {
@@ -10026,6 +10033,132 @@
10026
10033
  ]
10027
10034
  }
10028
10035
  ],
10036
+ "spacesToolbar.json": [
10037
+ {
10038
+ "namespace": "spacesToolbar",
10039
+ "types": [
10040
+ {
10041
+ "id": "ButtonProperties",
10042
+ "type": "object",
10043
+ "properties": {
10044
+ "badgeBackgroundColor": {
10045
+ "choices": [
10046
+ {
10047
+ "type": "string"
10048
+ },
10049
+ {
10050
+ "$ref": "ColorArray"
10051
+ }
10052
+ ],
10053
+ "optional": true,
10054
+ "description": "Sets the background color of the badge. Can be specified as an array of four integers in the range [0,255] that make up the RGBA color of the badge. For example, opaque red is <code>[255, 0, 0, 255]</code>. Can also be a string with an HTML color name (<code>red</code>) or a HEX color value (<code>#FF0000</code> or <code>#F00</code>). Reset when set to an empty string."
10055
+ },
10056
+ "badgeText": {
10057
+ "type": "string",
10058
+ "optional": true,
10059
+ "description": "Sets the badge text for the spaces toolbar button. The badge is displayed on top of the icon. Any number of characters can be set, but only about four can fit in the space. Removed when set to an empty string."
10060
+ },
10061
+ "defaultIcons": {
10062
+ "choices": [
10063
+ {
10064
+ "type": "string"
10065
+ },
10066
+ {
10067
+ "$ref": "manifest.IconPath"
10068
+ }
10069
+ ],
10070
+ "optional": true,
10071
+ "description": "Either a relative image path defining a single icon used for all sizes or an IconPathDictionary object defining dedicated icons for different sizes. At least the ``16px`` icon should be specified. The ``32px`` icon will be used on screens with a very high pixel density, if specified. Defaults to the extension icon, if set to an empty string."
10072
+ },
10073
+ "themeIcons": {
10074
+ "type": "array",
10075
+ "optional": true,
10076
+ "items": {
10077
+ "$ref": "manifest.ThemeIcons"
10078
+ },
10079
+ "description": "Specifies dark and light icons for the spaces toolbar button to be used with themes: The ``light`` icons will be used on dark backgrounds and vice versa. At least the set for ``16px`` icons should be specified. The set for ``32px`` icons will be used on screens with a very high pixel density, if specified."
10080
+ },
10081
+ "title": {
10082
+ "type": "string",
10083
+ "optional": true,
10084
+ "description": "The title for the spaces toolbar button, used in the tooltip of the button and as the displayed name in the overflow menu. Defaults to the name of the extension, if set to an empty string."
10085
+ },
10086
+ "url": {
10087
+ "type": "string",
10088
+ "optional": true,
10089
+ "description": "The page url, loaded into a tab when the button is clicked. Supported are ``https://`` and ``http://`` links, as well as links to WebExtension pages."
10090
+ }
10091
+ }
10092
+ },
10093
+ {
10094
+ "id": "ColorArray",
10095
+ "description": "An array of four integers in the range [0,255] that make up the RGBA color. For example, opaque red is <code>[255, 0, 0, 255]</code>.",
10096
+ "type": "array",
10097
+ "items": {
10098
+ "type": "integer",
10099
+ "minimum": 0,
10100
+ "maximum": 255
10101
+ },
10102
+ "minItems": 4,
10103
+ "maxItems": 4
10104
+ }
10105
+ ],
10106
+ "functions": [
10107
+ {
10108
+ "name": "addButton",
10109
+ "type": "function",
10110
+ "description": "Adds a new button to the spaces toolbar. Throws an exception, if the used ``id`` is not unique within the extension.",
10111
+ "async": true,
10112
+ "parameters": [
10113
+ {
10114
+ "name": "id",
10115
+ "type": "string",
10116
+ "pattern": "^[a-zA-Z0-9_]+$",
10117
+ "description": "The unique id to assign to this button. May only contain alphanumeric characters and underscores."
10118
+ },
10119
+ {
10120
+ "name": "properties",
10121
+ "description": "Properties of the new button. The ``url`` is mandatory.",
10122
+ "$ref": "spacesToolbar.ButtonProperties"
10123
+ }
10124
+ ]
10125
+ },
10126
+ {
10127
+ "name": "removeButton",
10128
+ "type": "function",
10129
+ "description": "Removes the specified button from the spaces toolbar. Throws an exception if the requested spaces toolbar button does not exist. If the tab of this button is currently open, it will be closed.",
10130
+ "async": true,
10131
+ "parameters": [
10132
+ {
10133
+ "name": "id",
10134
+ "type": "string",
10135
+ "pattern": "^[a-zA-Z0-9_]+$",
10136
+ "description": "The id of the button which is to be removed. May only contain alphanumeric characters and underscores."
10137
+ }
10138
+ ]
10139
+ },
10140
+ {
10141
+ "name": "updateButton",
10142
+ "type": "function",
10143
+ "description": "Updates properties of the specified spaces toolbar button. Throws an exception if the requested spaces toolbar button does not exist.",
10144
+ "async": true,
10145
+ "parameters": [
10146
+ {
10147
+ "name": "id",
10148
+ "type": "string",
10149
+ "description": "The id of the button which is to be updated. May only contain alphanumeric characters and underscores.",
10150
+ "pattern": "^[a-zA-Z0-9_]+$"
10151
+ },
10152
+ {
10153
+ "name": "properties",
10154
+ "description": "Only specified properties will be updated.",
10155
+ "$ref": "spacesToolbar.ButtonProperties"
10156
+ }
10157
+ ]
10158
+ }
10159
+ ]
10160
+ }
10161
+ ],
10029
10162
  "tabs.json": [
10030
10163
  {
10031
10164
  "namespace": "manifest",
@@ -10353,7 +10486,7 @@
10353
10486
  {
10354
10487
  "name": "create",
10355
10488
  "type": "function",
10356
- "description": "Creates a new tab or switches to a tab with the given URL, if it exists already.",
10489
+ "description": "Creates a new tab.",
10357
10490
  "async": "callback",
10358
10491
  "parameters": [
10359
10492
  {
@@ -15206,7 +15206,8 @@
15206
15206
  "s390x",
15207
15207
  "sparc64",
15208
15208
  "x86-32",
15209
- "x86-64"
15209
+ "x86-64",
15210
+ "noarch"
15210
15211
  ],
15211
15212
  "allowedContexts": [
15212
15213
  "content",
@@ -16028,6 +16029,65 @@
16028
16029
  "description": "Details specifying the target into which to inject the CSS."
16029
16030
  }
16030
16031
  }
16032
+ },
16033
+ {
16034
+ "id": "ContentScriptFilter",
16035
+ "type": "object",
16036
+ "properties": {
16037
+ "ids": {
16038
+ "type": "array",
16039
+ "optional": true,
16040
+ "description": "The IDs of specific scripts to retrieve with <code>getRegisteredContentScripts()</code> or to unregister with <code>unregisterContentScripts()</code>.",
16041
+ "items": {
16042
+ "type": "string"
16043
+ }
16044
+ }
16045
+ }
16046
+ },
16047
+ {
16048
+ "id": "RegisteredContentScript",
16049
+ "type": "object",
16050
+ "properties": {
16051
+ "allFrames": {
16052
+ "type": "boolean",
16053
+ "optional": true,
16054
+ "description": "If specified true, it will inject into all frames, even if the frame is not the top-most frame in the tab. Each frame is checked independently for URL requirements; it will not inject into child frames if the URL requirements are not met. Defaults to false, meaning that only the top frame is matched."
16055
+ },
16056
+ "excludeMatches": {
16057
+ "type": "array",
16058
+ "optional": true,
16059
+ "description": "Excludes pages that this content script would otherwise be injected into.",
16060
+ "items": {
16061
+ "type": "string"
16062
+ }
16063
+ },
16064
+ "id": {
16065
+ "type": "string",
16066
+ "description": "The id of the content script, specified in the API call."
16067
+ },
16068
+ "js": {
16069
+ "type": "array",
16070
+ "optional": true,
16071
+ "description": "The list of JavaScript files to be injected into matching pages. These are injected in the order they appear in this array.",
16072
+ "items": {
16073
+ "$ref": "manifest.ExtensionURL"
16074
+ }
16075
+ },
16076
+ "matches": {
16077
+ "type": "array",
16078
+ "optional": true,
16079
+ "description": "Specifies which pages this content script will be injected into. Must be specified for <code>registerContentScripts()</code>.",
16080
+ "items": {
16081
+ "type": "string"
16082
+ }
16083
+ },
16084
+ "runAt": {
16085
+ "$ref": "extensionTypes.RunAt",
16086
+ "optional": true,
16087
+ "default": "document_idle",
16088
+ "description": "Specifies when JavaScript files are injected into the web page. The preferred and default value is <code>document_idle</code>."
16089
+ }
16090
+ }
16031
16091
  }
16032
16092
  ],
16033
16093
  "functions": [
@@ -16095,6 +16155,76 @@
16095
16155
  "parameters": []
16096
16156
  }
16097
16157
  ]
16158
+ },
16159
+ {
16160
+ "name": "registerContentScripts",
16161
+ "type": "function",
16162
+ "description": "Registers one or more content scripts for this extension.",
16163
+ "async": "callback",
16164
+ "parameters": [
16165
+ {
16166
+ "name": "scripts",
16167
+ "type": "array",
16168
+ "description": "Contains a list of scripts to be registered. If there are errors during script parsing/file validation, or if the IDs specified already exist, then no scripts are registered.",
16169
+ "items": {
16170
+ "$ref": "RegisteredContentScript"
16171
+ }
16172
+ },
16173
+ {
16174
+ "name": "callback",
16175
+ "type": "function",
16176
+ "description": "Invoked upon completion of the registration.",
16177
+ "parameters": []
16178
+ }
16179
+ ]
16180
+ },
16181
+ {
16182
+ "name": "getRegisteredContentScripts",
16183
+ "type": "function",
16184
+ "description": "Returns all dynamically registered content scripts for this extension that match the given filter.",
16185
+ "async": "callback",
16186
+ "parameters": [
16187
+ {
16188
+ "name": "filter",
16189
+ "$ref": "ContentScriptFilter",
16190
+ "optional": true,
16191
+ "description": "An object to filter the extension's dynamically registered scripts."
16192
+ },
16193
+ {
16194
+ "name": "callback",
16195
+ "type": "function",
16196
+ "description": "The resulting array contains the registered content scripts.",
16197
+ "parameters": [
16198
+ {
16199
+ "name": "scripts",
16200
+ "type": "array",
16201
+ "items": {
16202
+ "$ref": "RegisteredContentScript"
16203
+ }
16204
+ }
16205
+ ]
16206
+ }
16207
+ ]
16208
+ },
16209
+ {
16210
+ "name": "unregisterContentScripts",
16211
+ "type": "function",
16212
+ "description": "Unregisters one or more content scripts for this extension.",
16213
+ "async": "callback",
16214
+ "parameters": [
16215
+ {
16216
+ "name": "filter",
16217
+ "$ref": "ContentScriptFilter",
16218
+ "optional": true,
16219
+ "description": "If specified, only unregisters dynamic content scripts which match the filter. Otherwise, all of the extension's dynamic content scripts are unregistered."
16220
+ },
16221
+ {
16222
+ "name": "callback",
16223
+ "type": "function",
16224
+ "description": "Invoked upon completion of the unregistration.",
16225
+ "parameters": []
16226
+ }
16227
+ ]
16098
16228
  }
16099
16229
  ]
16100
16230
  }