webext-schema 2.1.3 → 2.2.2

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.
@@ -4,7 +4,7 @@
4
4
 
5
5
  /* api */
6
6
  import { IS_WIN } from './constant.js';
7
- import { URL, fileURLToPath } from 'url';
7
+ import { fileURLToPath } from 'url';
8
8
  import { getType, isString } from './common.js';
9
9
  import fs, { promises as fsPromise } from 'fs';
10
10
  import path from 'path';
package/modules/update.js CHANGED
@@ -4,7 +4,6 @@
4
4
 
5
5
  /* api */
6
6
  import { CHAR, INDENT } from './constant.js';
7
- import { URL } from 'url';
8
7
  import JSON5 from 'json5';
9
8
  import { createFile } from './file-util.js';
10
9
  import { getType, isString } from './common.js';
package/package.json CHANGED
@@ -29,9 +29,9 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "camelize": "^1.0.0",
32
- "commander": "^9.0.0",
32
+ "commander": "^9.1.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
36
  "sinon": "^13.0.1"
37
37
  },
@@ -48,5 +48,5 @@
48
48
  "nock": "^13.2.4",
49
49
  "npm-run-all": "^4.1.5"
50
50
  },
51
- "version": "2.1.3"
51
+ "version": "2.2.2"
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": {
@@ -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
  },
@@ -15339,7 +15344,6 @@
15339
15344
  "functions": [
15340
15345
  {
15341
15346
  "name": "getBackgroundPage",
15342
- "max_manifest_version": 2,
15343
15347
  "type": "function",
15344
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.",
15345
15349
  "async": "callback",
@@ -15750,13 +15754,11 @@
15750
15754
  },
15751
15755
  {
15752
15756
  "name": "onSuspend",
15753
- "unsupported": true,
15754
15757
  "type": "function",
15755
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. "
15756
15759
  },
15757
15760
  {
15758
15761
  "name": "onSuspendCanceled",
15759
- "unsupported": true,
15760
15762
  "type": "function",
15761
15763
  "description": "Sent after onSuspend to indicate that the app won't be unloaded after all."
15762
15764
  },
@@ -15945,6 +15947,10 @@
15945
15947
  "target": {
15946
15948
  "$ref": "InjectionTarget",
15947
15949
  "description": "Details specifying the target into which to inject the script."
15950
+ },
15951
+ "world": {
15952
+ "$ref": "ExecutionWorld",
15953
+ "optional": true
15948
15954
  }
15949
15955
  }
15950
15956
  },
@@ -16046,6 +16052,14 @@
16046
16052
  }
16047
16053
  }
16048
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
+ },
16049
16063
  {
16050
16064
  "id": "RegisteredContentScript",
16051
16065
  "type": "object",
@@ -16086,7 +16100,6 @@
16086
16100
  "runAt": {
16087
16101
  "$ref": "extensionTypes.RunAt",
16088
16102
  "optional": true,
16089
- "default": "document_idle",
16090
16103
  "description": "Specifies when JavaScript files are injected into the web page. The preferred and default value is <code>document_idle</code>."
16091
16104
  },
16092
16105
  "persistAcrossSessions": {
@@ -16095,6 +16108,14 @@
16095
16108
  false
16096
16109
  ],
16097
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
+ }
16098
16119
  }
16099
16120
  }
16100
16121
  }
@@ -16234,6 +16255,39 @@
16234
16255
  "parameters": []
16235
16256
  }
16236
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
+ ]
16237
16291
  }
16238
16292
  ]
16239
16293
  }
@@ -17813,6 +17867,26 @@
17813
17867
  },
17814
17868
  "maxItems": 15,
17815
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
+ ]
17816
17890
  }
17817
17891
  },
17818
17892
  "additionalProperties": {
@@ -1711,7 +1711,6 @@
1711
1711
  "functions": [
1712
1712
  {
1713
1713
  "name": "getBackgroundPage",
1714
- "max_manifest_version": 2,
1715
1714
  "type": "function",
1716
1715
  "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.",
1717
1716
  "async": "callback",
@@ -2122,13 +2121,11 @@
2122
2121
  },
2123
2122
  {
2124
2123
  "name": "onSuspend",
2125
- "unsupported": true,
2126
2124
  "type": "function",
2127
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. "
2128
2126
  },
2129
2127
  {
2130
2128
  "name": "onSuspendCanceled",
2131
- "unsupported": true,
2132
2129
  "type": "function",
2133
2130
  "description": "Sent after onSuspend to indicate that the app won't be unloaded after all."
2134
2131
  },
@@ -2635,6 +2632,26 @@
2635
2632
  },
2636
2633
  "maxItems": 15,
2637
2634
  "optional": true
2635
+ },
2636
+ "color_scheme": {
2637
+ "description": "If set, overrides the general 'toolbar theme'.",
2638
+ "optional": true,
2639
+ "type": "string",
2640
+ "enum": [
2641
+ "light",
2642
+ "dark",
2643
+ "auto"
2644
+ ]
2645
+ },
2646
+ "content_color_scheme": {
2647
+ "description": "If set, overrides the color scheme for the content area.",
2648
+ "optional": true,
2649
+ "type": "string",
2650
+ "enum": [
2651
+ "light",
2652
+ "dark",
2653
+ "auto"
2654
+ ]
2638
2655
  }
2639
2656
  },
2640
2657
  "additionalProperties": {
@@ -4834,7 +4851,7 @@
4834
4851
  "properties": {
4835
4852
  "aborted": {
4836
4853
  "type": "boolean",
4837
- "description": "Set this to true if the file upload was aborted.",
4854
+ "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.",
4838
4855
  "optional": true
4839
4856
  },
4840
4857
  "error": {
@@ -5416,6 +5433,14 @@
5416
5433
  "description": "Whether the message is an HTML message or a plain text message.",
5417
5434
  "optional": true
5418
5435
  },
5436
+ "customHeaders": {
5437
+ "type": "array",
5438
+ "items": {
5439
+ "$ref": "CustomHeader"
5440
+ },
5441
+ "description": "Array of custom headers. Headers will be returned in ``Http-Header-Case`` (a.k.a. ``Train-Case``)",
5442
+ "optional": true
5443
+ },
5419
5444
  "attachments": {
5420
5445
  "type": "array",
5421
5446
  "items": {
@@ -5472,6 +5497,21 @@
5472
5497
  "description": "The size in bytes of this attachment. Read-only."
5473
5498
  }
5474
5499
  }
5500
+ },
5501
+ {
5502
+ "id": "CustomHeader",
5503
+ "type": "object",
5504
+ "description": "A custom header definition.",
5505
+ "properties": {
5506
+ "name": {
5507
+ "type": "string",
5508
+ "description": "Name of a custom header, must have a ``X-`` prefix.",
5509
+ "pattern": "^X-.*$"
5510
+ },
5511
+ "value": {
5512
+ "type": "string"
5513
+ }
5514
+ }
5475
5515
  }
5476
5516
  ],
5477
5517
  "events": [
@@ -10007,6 +10047,132 @@
10007
10047
  ]
10008
10048
  }
10009
10049
  ],
10050
+ "spacesToolbar.json": [
10051
+ {
10052
+ "namespace": "spacesToolbar",
10053
+ "types": [
10054
+ {
10055
+ "id": "ButtonProperties",
10056
+ "type": "object",
10057
+ "properties": {
10058
+ "badgeBackgroundColor": {
10059
+ "choices": [
10060
+ {
10061
+ "type": "string"
10062
+ },
10063
+ {
10064
+ "$ref": "ColorArray"
10065
+ }
10066
+ ],
10067
+ "optional": true,
10068
+ "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."
10069
+ },
10070
+ "badgeText": {
10071
+ "type": "string",
10072
+ "optional": true,
10073
+ "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."
10074
+ },
10075
+ "defaultIcons": {
10076
+ "choices": [
10077
+ {
10078
+ "type": "string"
10079
+ },
10080
+ {
10081
+ "$ref": "manifest.IconPath"
10082
+ }
10083
+ ],
10084
+ "optional": true,
10085
+ "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."
10086
+ },
10087
+ "themeIcons": {
10088
+ "type": "array",
10089
+ "optional": true,
10090
+ "items": {
10091
+ "$ref": "manifest.ThemeIcons"
10092
+ },
10093
+ "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."
10094
+ },
10095
+ "title": {
10096
+ "type": "string",
10097
+ "optional": true,
10098
+ "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."
10099
+ },
10100
+ "url": {
10101
+ "type": "string",
10102
+ "optional": true,
10103
+ "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."
10104
+ }
10105
+ }
10106
+ },
10107
+ {
10108
+ "id": "ColorArray",
10109
+ "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>.",
10110
+ "type": "array",
10111
+ "items": {
10112
+ "type": "integer",
10113
+ "minimum": 0,
10114
+ "maximum": 255
10115
+ },
10116
+ "minItems": 4,
10117
+ "maxItems": 4
10118
+ }
10119
+ ],
10120
+ "functions": [
10121
+ {
10122
+ "name": "addButton",
10123
+ "type": "function",
10124
+ "description": "Adds a new button to the spaces toolbar. Throws an exception, if the used ``id`` is not unique within the extension.",
10125
+ "async": true,
10126
+ "parameters": [
10127
+ {
10128
+ "name": "id",
10129
+ "type": "string",
10130
+ "pattern": "^[a-zA-Z0-9_]+$",
10131
+ "description": "The unique id to assign to this button. May only contain alphanumeric characters and underscores."
10132
+ },
10133
+ {
10134
+ "name": "properties",
10135
+ "description": "Properties of the new button. The ``url`` is mandatory.",
10136
+ "$ref": "spacesToolbar.ButtonProperties"
10137
+ }
10138
+ ]
10139
+ },
10140
+ {
10141
+ "name": "removeButton",
10142
+ "type": "function",
10143
+ "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.",
10144
+ "async": true,
10145
+ "parameters": [
10146
+ {
10147
+ "name": "id",
10148
+ "type": "string",
10149
+ "pattern": "^[a-zA-Z0-9_]+$",
10150
+ "description": "The id of the button which is to be removed. May only contain alphanumeric characters and underscores."
10151
+ }
10152
+ ]
10153
+ },
10154
+ {
10155
+ "name": "updateButton",
10156
+ "type": "function",
10157
+ "description": "Updates properties of the specified spaces toolbar button. Throws an exception if the requested spaces toolbar button does not exist.",
10158
+ "async": true,
10159
+ "parameters": [
10160
+ {
10161
+ "name": "id",
10162
+ "type": "string",
10163
+ "description": "The id of the button which is to be updated. May only contain alphanumeric characters and underscores.",
10164
+ "pattern": "^[a-zA-Z0-9_]+$"
10165
+ },
10166
+ {
10167
+ "name": "properties",
10168
+ "description": "Only specified properties will be updated.",
10169
+ "$ref": "spacesToolbar.ButtonProperties"
10170
+ }
10171
+ ]
10172
+ }
10173
+ ]
10174
+ }
10175
+ ],
10010
10176
  "tabs.json": [
10011
10177
  {
10012
10178
  "namespace": "manifest",
@@ -11776,6 +11776,7 @@
11776
11776
  "samplingallthreads",
11777
11777
  "markersallthreads",
11778
11778
  "unregisteredthreads",
11779
+ "processcpu",
11779
11780
  "responsiveness"
11780
11781
  ]
11781
11782
  },
@@ -12895,7 +12896,9 @@
12895
12896
  },
12896
12897
  "persistent": {
12897
12898
  "optional": true,
12898
- "$ref": "PersistentBackgroundProperty"
12899
+ "type": "boolean",
12900
+ "max_manifest_version": 2,
12901
+ "default": true
12899
12902
  }
12900
12903
  },
12901
12904
  "additionalProperties": {
@@ -12913,7 +12916,9 @@
12913
12916
  },
12914
12917
  "persistent": {
12915
12918
  "optional": true,
12916
- "$ref": "PersistentBackgroundProperty"
12919
+ "type": "boolean",
12920
+ "max_manifest_version": 2,
12921
+ "default": true
12917
12922
  }
12918
12923
  },
12919
12924
  "additionalProperties": {
@@ -13536,24 +13541,6 @@
13536
13541
  "id": "UnrecognizedProperty",
13537
13542
  "type": "any",
13538
13543
  "deprecated": "An unexpected property was found in the WebExtension manifest."
13539
- },
13540
- {
13541
- "id": "PersistentBackgroundProperty",
13542
- "choices": [
13543
- {
13544
- "type": "boolean",
13545
- "enum": [
13546
- true
13547
- ]
13548
- },
13549
- {
13550
- "type": "boolean",
13551
- "enum": [
13552
- false
13553
- ],
13554
- "deprecated": "Event pages are not currently supported. This will run as a persistent background page."
13555
- }
13556
- ]
13557
13544
  }
13558
13545
  ]
13559
13546
  }
@@ -15219,7 +15206,8 @@
15219
15206
  "s390x",
15220
15207
  "sparc64",
15221
15208
  "x86-32",
15222
- "x86-64"
15209
+ "x86-64",
15210
+ "noarch"
15223
15211
  ],
15224
15212
  "allowedContexts": [
15225
15213
  "content",
@@ -15941,7 +15929,7 @@
15941
15929
  "files": {
15942
15930
  "type": "array",
15943
15931
  "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.",
15932
+ "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
15933
  "minItems": 1,
15946
15934
  "items": {
15947
15935
  "type": "string"
@@ -15964,13 +15952,24 @@
15964
15952
  "description": "Result of a script injection.",
15965
15953
  "properties": {
15966
15954
  "frameId": {
15967
- "type": "number",
15955
+ "type": "integer",
15968
15956
  "description": "The frame ID associated with the injection."
15969
15957
  },
15970
15958
  "result": {
15971
15959
  "type": "any",
15972
15960
  "optional": true,
15973
15961
  "description": "The result of the script execution."
15962
+ },
15963
+ "error": {
15964
+ "type": "object",
15965
+ "optional": true,
15966
+ "description": "When the injection has failed, the error is exposed to the caller with this property.",
15967
+ "properties": {
15968
+ "message": {
15969
+ "type": "string",
15970
+ "description": "A message explaining why the injection has failed."
15971
+ }
15972
+ }
15974
15973
  }
15975
15974
  }
15976
15975
  },
@@ -15986,11 +15985,109 @@
15986
15985
  "type": "number"
15987
15986
  }
15988
15987
  },
15988
+ "allFrames": {
15989
+ "type": "boolean",
15990
+ "optional": true,
15991
+ "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."
15992
+ },
15989
15993
  "tabId": {
15990
15994
  "type": "number",
15991
15995
  "description": "The ID of the tab into which to inject."
15992
15996
  }
15993
15997
  }
15998
+ },
15999
+ {
16000
+ "id": "CSSInjection",
16001
+ "type": "object",
16002
+ "properties": {
16003
+ "css": {
16004
+ "type": "string",
16005
+ "optional": true,
16006
+ "description": "A string containing the CSS to inject. Exactly one of <code>files</code> and <code>css</code> must be specified."
16007
+ },
16008
+ "files": {
16009
+ "type": "array",
16010
+ "optional": true,
16011
+ "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.",
16012
+ "minItems": 1,
16013
+ "items": {
16014
+ "type": "string"
16015
+ }
16016
+ },
16017
+ "origin": {
16018
+ "type": "string",
16019
+ "optional": true,
16020
+ "enum": [
16021
+ "USER",
16022
+ "AUTHOR"
16023
+ ],
16024
+ "default": "AUTHOR",
16025
+ "description": "The style origin for the injection. Defaults to <code>'AUTHOR'</code>."
16026
+ },
16027
+ "target": {
16028
+ "$ref": "InjectionTarget",
16029
+ "description": "Details specifying the target into which to inject the CSS."
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
+ }
15994
16091
  }
15995
16092
  ],
15996
16093
  "functions": [
@@ -16020,6 +16117,114 @@
16020
16117
  ]
16021
16118
  }
16022
16119
  ]
16120
+ },
16121
+ {
16122
+ "name": "insertCSS",
16123
+ "type": "function",
16124
+ "description": "Inserts a CSS stylesheet into a target context. If multiple frames are specified, unsuccessful injections are ignored.",
16125
+ "async": "callback",
16126
+ "parameters": [
16127
+ {
16128
+ "name": "injection",
16129
+ "$ref": "CSSInjection",
16130
+ "description": "The details of the styles to insert."
16131
+ },
16132
+ {
16133
+ "name": "callback",
16134
+ "type": "function",
16135
+ "description": "Invoked upon completion of the injection.",
16136
+ "parameters": []
16137
+ }
16138
+ ]
16139
+ },
16140
+ {
16141
+ "name": "removeCSS",
16142
+ "type": "function",
16143
+ "description": "Removes a CSS stylesheet that was previously inserted by this extension from a target context.",
16144
+ "async": "callback",
16145
+ "parameters": [
16146
+ {
16147
+ "name": "injection",
16148
+ "$ref": "CSSInjection",
16149
+ "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."
16150
+ },
16151
+ {
16152
+ "name": "callback",
16153
+ "type": "function",
16154
+ "description": "Invoked upon completion of the injection.",
16155
+ "parameters": []
16156
+ }
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
+ ]
16023
16228
  }
16024
16229
  ]
16025
16230
  }
@@ -18009,6 +18214,22 @@
18009
18214
  "default": "document_idle",
18010
18215
  "optional": true,
18011
18216
  "description": "The soonest that the JavaScript will be injected into the tab. Defaults to \"document_idle\"."
18217
+ },
18218
+ "cookieStoreId": {
18219
+ "choices": [
18220
+ {
18221
+ "type": "array",
18222
+ "minItems": 1,
18223
+ "items": {
18224
+ "type": "string"
18225
+ }
18226
+ },
18227
+ {
18228
+ "type": "string"
18229
+ }
18230
+ ],
18231
+ "optional": true,
18232
+ "description": "limit the set of matched tabs to those that belong to the given cookie store id"
18012
18233
  }
18013
18234
  }
18014
18235
  },