webext-schema 2.0.5 → 2.0.9

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/modules/update.js CHANGED
@@ -8,7 +8,7 @@ import { URL } from 'url';
8
8
  import JSON5 from 'json5';
9
9
  import { createFile } from './file-util.js';
10
10
  import { getType, isString } from './common.js';
11
- import commander from 'commander';
11
+ import { program as commander } from 'commander';
12
12
  import fetch from 'node-fetch';
13
13
  import path from 'path';
14
14
  import process from 'process';
package/package.json CHANGED
@@ -24,23 +24,23 @@
24
24
  },
25
25
  "dependencies": {
26
26
  "camelize": "^1.0.0",
27
- "commander": "^8.3.0",
27
+ "commander": "^9.0.0",
28
28
  "decamelize": "^6.0.0",
29
29
  "json5": "^2.2.0",
30
- "node-fetch": "^3.1.0",
31
- "sinon": "^12.0.1"
30
+ "node-fetch": "^3.2.0",
31
+ "sinon": "^13.0.1"
32
32
  },
33
33
  "devDependencies": {
34
- "c8": "^7.10.0",
35
- "chai": "^4.3.4",
34
+ "c8": "^7.11.0",
35
+ "chai": "^4.3.6",
36
36
  "eslint": "^7.32.0",
37
37
  "eslint-config-standard": "^16.0.3",
38
- "eslint-plugin-import": "^2.25.3",
39
- "eslint-plugin-jsdoc": "^37.1.0",
38
+ "eslint-plugin-import": "^2.25.4",
39
+ "eslint-plugin-jsdoc": "^37.8.2",
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.4"
44
44
  },
45
- "version": "2.0.5"
45
+ "version": "2.0.9"
46
46
  }
@@ -5165,7 +5165,17 @@
5165
5165
  "description": "The position of the tabs within their windows."
5166
5166
  },
5167
5167
  "cookieStoreId": {
5168
- "type": "string",
5168
+ "choices": [
5169
+ {
5170
+ "type": "array",
5171
+ "items": {
5172
+ "type": "string"
5173
+ }
5174
+ },
5175
+ {
5176
+ "type": "string"
5177
+ }
5178
+ ],
5169
5179
  "optional": true,
5170
5180
  "description": "The CookieStoreId used for the tab."
5171
5181
  },
@@ -9033,6 +9043,22 @@
9033
9043
  "$ref": "extensionTypes.RunAt",
9034
9044
  "optional": true,
9035
9045
  "description": "The soonest that the JavaScript or CSS will be injected into the tab. Defaults to \"document_idle\"."
9046
+ },
9047
+ "cookieStoreId": {
9048
+ "choices": [
9049
+ {
9050
+ "type": "array",
9051
+ "minItems": 1,
9052
+ "items": {
9053
+ "type": "string"
9054
+ }
9055
+ },
9056
+ {
9057
+ "type": "string"
9058
+ }
9059
+ ],
9060
+ "optional": true,
9061
+ "description": "limit the set of matched tabs to those that belong to the given cookie store id"
9036
9062
  }
9037
9063
  }
9038
9064
  },
@@ -11737,7 +11763,6 @@
11737
11763
  "screenshots",
11738
11764
  "seqstyle",
11739
11765
  "stackwalk",
11740
- "threads",
11741
11766
  "jstracer",
11742
11767
  "jsallocations",
11743
11768
  "nostacksampling",
@@ -11751,6 +11776,7 @@
11751
11776
  "samplingallthreads",
11752
11777
  "markersallthreads",
11753
11778
  "unregisteredthreads",
11779
+ "processcpu",
11754
11780
  "responsiveness"
11755
11781
  ]
11756
11782
  },
@@ -12870,7 +12896,9 @@
12870
12896
  },
12871
12897
  "persistent": {
12872
12898
  "optional": true,
12873
- "$ref": "PersistentBackgroundProperty"
12899
+ "type": "boolean",
12900
+ "max_manifest_version": 2,
12901
+ "default": true
12874
12902
  }
12875
12903
  },
12876
12904
  "additionalProperties": {
@@ -12888,7 +12916,9 @@
12888
12916
  },
12889
12917
  "persistent": {
12890
12918
  "optional": true,
12891
- "$ref": "PersistentBackgroundProperty"
12919
+ "type": "boolean",
12920
+ "max_manifest_version": 2,
12921
+ "default": true
12892
12922
  }
12893
12923
  },
12894
12924
  "additionalProperties": {
@@ -13147,6 +13177,30 @@
13147
13177
  }
13148
13178
  }
13149
13179
  },
13180
+ {
13181
+ "id": "WebExtensionSitePermissionsManifest",
13182
+ "type": "object",
13183
+ "description": "Represents a WebExtension site permissions manifest.json file",
13184
+ "$import": "ManifestBase",
13185
+ "properties": {
13186
+ "site_permissions": {
13187
+ "type": "array",
13188
+ "minItems": 1,
13189
+ "items": {
13190
+ "$ref": "SitePermission"
13191
+ }
13192
+ },
13193
+ "install_origins": {
13194
+ "type": "array",
13195
+ "minItems": 1,
13196
+ "maxItems": 1,
13197
+ "items": {
13198
+ "type": "string",
13199
+ "format": "origin"
13200
+ }
13201
+ }
13202
+ }
13203
+ },
13150
13204
  {
13151
13205
  "id": "ThemeIcons",
13152
13206
  "type": "object",
@@ -13246,6 +13300,18 @@
13246
13300
  }
13247
13301
  ]
13248
13302
  },
13303
+ {
13304
+ "id": "SitePermission",
13305
+ "choices": [
13306
+ {
13307
+ "type": "string",
13308
+ "enum": [
13309
+ "midi",
13310
+ "midi-sysex"
13311
+ ]
13312
+ }
13313
+ ]
13314
+ },
13249
13315
  {
13250
13316
  "id": "HttpURL",
13251
13317
  "type": "string",
@@ -13475,24 +13541,6 @@
13475
13541
  "id": "UnrecognizedProperty",
13476
13542
  "type": "any",
13477
13543
  "deprecated": "An unexpected property was found in the WebExtension manifest."
13478
- },
13479
- {
13480
- "id": "PersistentBackgroundProperty",
13481
- "choices": [
13482
- {
13483
- "type": "boolean",
13484
- "enum": [
13485
- true
13486
- ]
13487
- },
13488
- {
13489
- "type": "boolean",
13490
- "enum": [
13491
- false
13492
- ],
13493
- "deprecated": "Event pages are not currently supported. This will run as a persistent background page."
13494
- }
13495
- ]
13496
13544
  }
13497
13545
  ]
13498
13546
  }
@@ -15880,7 +15928,7 @@
15880
15928
  "files": {
15881
15929
  "type": "array",
15882
15930
  "optional": true,
15883
- "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.",
15931
+ "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.",
15884
15932
  "minItems": 1,
15885
15933
  "items": {
15886
15934
  "type": "string"
@@ -15903,13 +15951,24 @@
15903
15951
  "description": "Result of a script injection.",
15904
15952
  "properties": {
15905
15953
  "frameId": {
15906
- "type": "number",
15954
+ "type": "integer",
15907
15955
  "description": "The frame ID associated with the injection."
15908
15956
  },
15909
15957
  "result": {
15910
15958
  "type": "any",
15911
15959
  "optional": true,
15912
15960
  "description": "The result of the script execution."
15961
+ },
15962
+ "error": {
15963
+ "type": "object",
15964
+ "optional": true,
15965
+ "description": "When the injection has failed, the error is exposed to the caller with this property.",
15966
+ "properties": {
15967
+ "message": {
15968
+ "type": "string",
15969
+ "description": "A message explaining why the injection has failed."
15970
+ }
15971
+ }
15913
15972
  }
15914
15973
  }
15915
15974
  },
@@ -15925,11 +15984,50 @@
15925
15984
  "type": "number"
15926
15985
  }
15927
15986
  },
15987
+ "allFrames": {
15988
+ "type": "boolean",
15989
+ "optional": true,
15990
+ "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."
15991
+ },
15928
15992
  "tabId": {
15929
15993
  "type": "number",
15930
15994
  "description": "The ID of the tab into which to inject."
15931
15995
  }
15932
15996
  }
15997
+ },
15998
+ {
15999
+ "id": "CSSInjection",
16000
+ "type": "object",
16001
+ "properties": {
16002
+ "css": {
16003
+ "type": "string",
16004
+ "optional": true,
16005
+ "description": "A string containing the CSS to inject. Exactly one of <code>files</code> and <code>css</code> must be specified."
16006
+ },
16007
+ "files": {
16008
+ "type": "array",
16009
+ "optional": true,
16010
+ "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.",
16011
+ "minItems": 1,
16012
+ "items": {
16013
+ "type": "string"
16014
+ }
16015
+ },
16016
+ "origin": {
16017
+ "type": "string",
16018
+ "optional": true,
16019
+ "enum": [
16020
+ "USER",
16021
+ "AUTHOR"
16022
+ ],
16023
+ "default": "AUTHOR",
16024
+ "description": "The style origin for the injection. Defaults to <code>'AUTHOR'</code>."
16025
+ },
16026
+ "target": {
16027
+ "$ref": "InjectionTarget",
16028
+ "description": "Details specifying the target into which to inject the CSS."
16029
+ }
16030
+ }
15933
16031
  }
15934
16032
  ],
15935
16033
  "functions": [
@@ -15959,6 +16057,44 @@
15959
16057
  ]
15960
16058
  }
15961
16059
  ]
16060
+ },
16061
+ {
16062
+ "name": "insertCSS",
16063
+ "type": "function",
16064
+ "description": "Inserts a CSS stylesheet into a target context. If multiple frames are specified, unsuccessful injections are ignored.",
16065
+ "async": "callback",
16066
+ "parameters": [
16067
+ {
16068
+ "name": "injection",
16069
+ "$ref": "CSSInjection",
16070
+ "description": "The details of the styles to insert."
16071
+ },
16072
+ {
16073
+ "name": "callback",
16074
+ "type": "function",
16075
+ "description": "Invoked upon completion of the injection.",
16076
+ "parameters": []
16077
+ }
16078
+ ]
16079
+ },
16080
+ {
16081
+ "name": "removeCSS",
16082
+ "type": "function",
16083
+ "description": "Removes a CSS stylesheet that was previously inserted by this extension from a target context.",
16084
+ "async": "callback",
16085
+ "parameters": [
16086
+ {
16087
+ "name": "injection",
16088
+ "$ref": "CSSInjection",
16089
+ "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."
16090
+ },
16091
+ {
16092
+ "name": "callback",
16093
+ "type": "function",
16094
+ "description": "Invoked upon completion of the injection.",
16095
+ "parameters": []
16096
+ }
16097
+ ]
15962
16098
  }
15963
16099
  ]
15964
16100
  }
@@ -17948,6 +18084,22 @@
17948
18084
  "default": "document_idle",
17949
18085
  "optional": true,
17950
18086
  "description": "The soonest that the JavaScript will be injected into the tab. Defaults to \"document_idle\"."
18087
+ },
18088
+ "cookieStoreId": {
18089
+ "choices": [
18090
+ {
18091
+ "type": "array",
18092
+ "minItems": 1,
18093
+ "items": {
18094
+ "type": "string"
18095
+ }
18096
+ },
18097
+ {
18098
+ "type": "string"
18099
+ }
18100
+ ],
18101
+ "optional": true,
18102
+ "description": "limit the set of matched tabs to those that belong to the given cookie store id"
17951
18103
  }
17952
18104
  }
17953
18105
  },
@@ -5165,7 +5165,17 @@
5165
5165
  "description": "The position of the tabs within their windows."
5166
5166
  },
5167
5167
  "cookieStoreId": {
5168
- "type": "string",
5168
+ "choices": [
5169
+ {
5170
+ "type": "array",
5171
+ "items": {
5172
+ "type": "string"
5173
+ }
5174
+ },
5175
+ {
5176
+ "type": "string"
5177
+ }
5178
+ ],
5169
5179
  "optional": true,
5170
5180
  "description": "The CookieStoreId used for the tab."
5171
5181
  },
@@ -9033,6 +9043,22 @@
9033
9043
  "$ref": "extensionTypes.RunAt",
9034
9044
  "optional": true,
9035
9045
  "description": "The soonest that the JavaScript or CSS will be injected into the tab. Defaults to \"document_idle\"."
9046
+ },
9047
+ "cookieStoreId": {
9048
+ "choices": [
9049
+ {
9050
+ "type": "array",
9051
+ "minItems": 1,
9052
+ "items": {
9053
+ "type": "string"
9054
+ }
9055
+ },
9056
+ {
9057
+ "type": "string"
9058
+ }
9059
+ ],
9060
+ "optional": true,
9061
+ "description": "limit the set of matched tabs to those that belong to the given cookie store id"
9036
9062
  }
9037
9063
  }
9038
9064
  },
@@ -11737,7 +11763,6 @@
11737
11763
  "screenshots",
11738
11764
  "seqstyle",
11739
11765
  "stackwalk",
11740
- "threads",
11741
11766
  "jstracer",
11742
11767
  "jsallocations",
11743
11768
  "nostacksampling",
@@ -11751,6 +11776,7 @@
11751
11776
  "samplingallthreads",
11752
11777
  "markersallthreads",
11753
11778
  "unregisteredthreads",
11779
+ "processcpu",
11754
11780
  "responsiveness"
11755
11781
  ]
11756
11782
  },
@@ -12870,7 +12896,9 @@
12870
12896
  },
12871
12897
  "persistent": {
12872
12898
  "optional": true,
12873
- "$ref": "PersistentBackgroundProperty"
12899
+ "type": "boolean",
12900
+ "max_manifest_version": 2,
12901
+ "default": true
12874
12902
  }
12875
12903
  },
12876
12904
  "additionalProperties": {
@@ -12888,7 +12916,9 @@
12888
12916
  },
12889
12917
  "persistent": {
12890
12918
  "optional": true,
12891
- "$ref": "PersistentBackgroundProperty"
12919
+ "type": "boolean",
12920
+ "max_manifest_version": 2,
12921
+ "default": true
12892
12922
  }
12893
12923
  },
12894
12924
  "additionalProperties": {
@@ -13147,6 +13177,30 @@
13147
13177
  }
13148
13178
  }
13149
13179
  },
13180
+ {
13181
+ "id": "WebExtensionSitePermissionsManifest",
13182
+ "type": "object",
13183
+ "description": "Represents a WebExtension site permissions manifest.json file",
13184
+ "$import": "ManifestBase",
13185
+ "properties": {
13186
+ "site_permissions": {
13187
+ "type": "array",
13188
+ "minItems": 1,
13189
+ "items": {
13190
+ "$ref": "SitePermission"
13191
+ }
13192
+ },
13193
+ "install_origins": {
13194
+ "type": "array",
13195
+ "minItems": 1,
13196
+ "maxItems": 1,
13197
+ "items": {
13198
+ "type": "string",
13199
+ "format": "origin"
13200
+ }
13201
+ }
13202
+ }
13203
+ },
13150
13204
  {
13151
13205
  "id": "ThemeIcons",
13152
13206
  "type": "object",
@@ -13246,6 +13300,18 @@
13246
13300
  }
13247
13301
  ]
13248
13302
  },
13303
+ {
13304
+ "id": "SitePermission",
13305
+ "choices": [
13306
+ {
13307
+ "type": "string",
13308
+ "enum": [
13309
+ "midi",
13310
+ "midi-sysex"
13311
+ ]
13312
+ }
13313
+ ]
13314
+ },
13249
13315
  {
13250
13316
  "id": "HttpURL",
13251
13317
  "type": "string",
@@ -13475,24 +13541,6 @@
13475
13541
  "id": "UnrecognizedProperty",
13476
13542
  "type": "any",
13477
13543
  "deprecated": "An unexpected property was found in the WebExtension manifest."
13478
- },
13479
- {
13480
- "id": "PersistentBackgroundProperty",
13481
- "choices": [
13482
- {
13483
- "type": "boolean",
13484
- "enum": [
13485
- true
13486
- ]
13487
- },
13488
- {
13489
- "type": "boolean",
13490
- "enum": [
13491
- false
13492
- ],
13493
- "deprecated": "Event pages are not currently supported. This will run as a persistent background page."
13494
- }
13495
- ]
13496
13544
  }
13497
13545
  ]
13498
13546
  }
@@ -15880,7 +15928,7 @@
15880
15928
  "files": {
15881
15929
  "type": "array",
15882
15930
  "optional": true,
15883
- "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.",
15931
+ "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.",
15884
15932
  "minItems": 1,
15885
15933
  "items": {
15886
15934
  "type": "string"
@@ -15903,13 +15951,24 @@
15903
15951
  "description": "Result of a script injection.",
15904
15952
  "properties": {
15905
15953
  "frameId": {
15906
- "type": "number",
15954
+ "type": "integer",
15907
15955
  "description": "The frame ID associated with the injection."
15908
15956
  },
15909
15957
  "result": {
15910
15958
  "type": "any",
15911
15959
  "optional": true,
15912
15960
  "description": "The result of the script execution."
15961
+ },
15962
+ "error": {
15963
+ "type": "object",
15964
+ "optional": true,
15965
+ "description": "When the injection has failed, the error is exposed to the caller with this property.",
15966
+ "properties": {
15967
+ "message": {
15968
+ "type": "string",
15969
+ "description": "A message explaining why the injection has failed."
15970
+ }
15971
+ }
15913
15972
  }
15914
15973
  }
15915
15974
  },
@@ -15925,11 +15984,50 @@
15925
15984
  "type": "number"
15926
15985
  }
15927
15986
  },
15987
+ "allFrames": {
15988
+ "type": "boolean",
15989
+ "optional": true,
15990
+ "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."
15991
+ },
15928
15992
  "tabId": {
15929
15993
  "type": "number",
15930
15994
  "description": "The ID of the tab into which to inject."
15931
15995
  }
15932
15996
  }
15997
+ },
15998
+ {
15999
+ "id": "CSSInjection",
16000
+ "type": "object",
16001
+ "properties": {
16002
+ "css": {
16003
+ "type": "string",
16004
+ "optional": true,
16005
+ "description": "A string containing the CSS to inject. Exactly one of <code>files</code> and <code>css</code> must be specified."
16006
+ },
16007
+ "files": {
16008
+ "type": "array",
16009
+ "optional": true,
16010
+ "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.",
16011
+ "minItems": 1,
16012
+ "items": {
16013
+ "type": "string"
16014
+ }
16015
+ },
16016
+ "origin": {
16017
+ "type": "string",
16018
+ "optional": true,
16019
+ "enum": [
16020
+ "USER",
16021
+ "AUTHOR"
16022
+ ],
16023
+ "default": "AUTHOR",
16024
+ "description": "The style origin for the injection. Defaults to <code>'AUTHOR'</code>."
16025
+ },
16026
+ "target": {
16027
+ "$ref": "InjectionTarget",
16028
+ "description": "Details specifying the target into which to inject the CSS."
16029
+ }
16030
+ }
15933
16031
  }
15934
16032
  ],
15935
16033
  "functions": [
@@ -15959,6 +16057,44 @@
15959
16057
  ]
15960
16058
  }
15961
16059
  ]
16060
+ },
16061
+ {
16062
+ "name": "insertCSS",
16063
+ "type": "function",
16064
+ "description": "Inserts a CSS stylesheet into a target context. If multiple frames are specified, unsuccessful injections are ignored.",
16065
+ "async": "callback",
16066
+ "parameters": [
16067
+ {
16068
+ "name": "injection",
16069
+ "$ref": "CSSInjection",
16070
+ "description": "The details of the styles to insert."
16071
+ },
16072
+ {
16073
+ "name": "callback",
16074
+ "type": "function",
16075
+ "description": "Invoked upon completion of the injection.",
16076
+ "parameters": []
16077
+ }
16078
+ ]
16079
+ },
16080
+ {
16081
+ "name": "removeCSS",
16082
+ "type": "function",
16083
+ "description": "Removes a CSS stylesheet that was previously inserted by this extension from a target context.",
16084
+ "async": "callback",
16085
+ "parameters": [
16086
+ {
16087
+ "name": "injection",
16088
+ "$ref": "CSSInjection",
16089
+ "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."
16090
+ },
16091
+ {
16092
+ "name": "callback",
16093
+ "type": "function",
16094
+ "description": "Invoked upon completion of the injection.",
16095
+ "parameters": []
16096
+ }
16097
+ ]
15962
16098
  }
15963
16099
  ]
15964
16100
  }
@@ -17948,6 +18084,22 @@
17948
18084
  "default": "document_idle",
17949
18085
  "optional": true,
17950
18086
  "description": "The soonest that the JavaScript will be injected into the tab. Defaults to \"document_idle\"."
18087
+ },
18088
+ "cookieStoreId": {
18089
+ "choices": [
18090
+ {
18091
+ "type": "array",
18092
+ "minItems": 1,
18093
+ "items": {
18094
+ "type": "string"
18095
+ }
18096
+ },
18097
+ {
18098
+ "type": "string"
18099
+ }
18100
+ ],
18101
+ "optional": true,
18102
+ "description": "limit the set of matched tabs to those that belong to the given cookie store id"
17951
18103
  }
17952
18104
  }
17953
18105
  },