webext-schema 2.1.3 → 2.2.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.
@@ -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,7 +29,7 @@
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
34
  "json5": "^2.2.0",
35
35
  "node-fetch": "^3.2.3",
@@ -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.0"
52
52
  }
@@ -15339,7 +15339,6 @@
15339
15339
  "functions": [
15340
15340
  {
15341
15341
  "name": "getBackgroundPage",
15342
- "max_manifest_version": 2,
15343
15342
  "type": "function",
15344
15343
  "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
15344
  "async": "callback",
@@ -15945,6 +15944,10 @@
15945
15944
  "target": {
15946
15945
  "$ref": "InjectionTarget",
15947
15946
  "description": "Details specifying the target into which to inject the script."
15947
+ },
15948
+ "world": {
15949
+ "$ref": "ExecutionWorld",
15950
+ "optional": true
15948
15951
  }
15949
15952
  }
15950
15953
  },
@@ -16046,6 +16049,14 @@
16046
16049
  }
16047
16050
  }
16048
16051
  },
16052
+ {
16053
+ "id": "ExecutionWorld",
16054
+ "type": "string",
16055
+ "enum": [
16056
+ "ISOLATED"
16057
+ ],
16058
+ "description": "The JavaScript world for a script to execute within. We currently only support the <code>'ISOLATED'</code> world."
16059
+ },
16049
16060
  {
16050
16061
  "id": "RegisteredContentScript",
16051
16062
  "type": "object",
@@ -16086,7 +16097,6 @@
16086
16097
  "runAt": {
16087
16098
  "$ref": "extensionTypes.RunAt",
16088
16099
  "optional": true,
16089
- "default": "document_idle",
16090
16100
  "description": "Specifies when JavaScript files are injected into the web page. The preferred and default value is <code>document_idle</code>."
16091
16101
  },
16092
16102
  "persistAcrossSessions": {
@@ -16095,6 +16105,14 @@
16095
16105
  false
16096
16106
  ],
16097
16107
  "description": "Specifies if this content script will persist into future sessions. This is currently NOT supported."
16108
+ },
16109
+ "css": {
16110
+ "type": "array",
16111
+ "optional": true,
16112
+ "description": "The list of CSS files to be injected into matching pages. These are injected in the order they appear in this array.",
16113
+ "items": {
16114
+ "$ref": "manifest.ExtensionURL"
16115
+ }
16098
16116
  }
16099
16117
  }
16100
16118
  }
@@ -16234,6 +16252,39 @@
16234
16252
  "parameters": []
16235
16253
  }
16236
16254
  ]
16255
+ },
16256
+ {
16257
+ "name": "updateContentScripts",
16258
+ "type": "function",
16259
+ "description": "Updates one or more content scripts for this extension.",
16260
+ "async": "callback",
16261
+ "parameters": [
16262
+ {
16263
+ "name": "scripts",
16264
+ "type": "array",
16265
+ "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.",
16266
+ "items": {
16267
+ "type": "object",
16268
+ "$import": "RegisteredContentScript",
16269
+ "properties": {
16270
+ "persistAcrossSessions": {
16271
+ "type": "boolean",
16272
+ "optional": true,
16273
+ "enum": [
16274
+ false
16275
+ ],
16276
+ "description": "Specifies if this content script will persist into future sessions. This is currently NOT supported."
16277
+ }
16278
+ }
16279
+ }
16280
+ },
16281
+ {
16282
+ "name": "callback",
16283
+ "type": "function",
16284
+ "description": "Invoked when scripts have been updated.",
16285
+ "parameters": []
16286
+ }
16287
+ ]
16237
16288
  }
16238
16289
  ]
16239
16290
  }
@@ -17813,6 +17864,26 @@
17813
17864
  },
17814
17865
  "maxItems": 15,
17815
17866
  "optional": true
17867
+ },
17868
+ "color_scheme": {
17869
+ "optional": true,
17870
+ "type": "string",
17871
+ "enum": [
17872
+ "auto",
17873
+ "light",
17874
+ "dark",
17875
+ "system"
17876
+ ]
17877
+ },
17878
+ "content_color_scheme": {
17879
+ "optional": true,
17880
+ "type": "string",
17881
+ "enum": [
17882
+ "auto",
17883
+ "light",
17884
+ "dark",
17885
+ "system"
17886
+ ]
17816
17887
  }
17817
17888
  },
17818
17889
  "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",
@@ -2635,6 +2634,26 @@
2635
2634
  },
2636
2635
  "maxItems": 15,
2637
2636
  "optional": true
2637
+ },
2638
+ "color_scheme": {
2639
+ "description": "If set, overrides the general 'toolbar theme'.",
2640
+ "optional": true,
2641
+ "type": "string",
2642
+ "enum": [
2643
+ "light",
2644
+ "dark",
2645
+ "auto"
2646
+ ]
2647
+ },
2648
+ "content_color_scheme": {
2649
+ "description": "If set, overrides the color scheme for the content area.",
2650
+ "optional": true,
2651
+ "type": "string",
2652
+ "enum": [
2653
+ "light",
2654
+ "dark",
2655
+ "auto"
2656
+ ]
2638
2657
  }
2639
2658
  },
2640
2659
  "additionalProperties": {
@@ -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
  }
@@ -15941,7 +15928,7 @@
15941
15928
  "files": {
15942
15929
  "type": "array",
15943
15930
  "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.",
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.",
15945
15932
  "minItems": 1,
15946
15933
  "items": {
15947
15934
  "type": "string"
@@ -15964,13 +15951,24 @@
15964
15951
  "description": "Result of a script injection.",
15965
15952
  "properties": {
15966
15953
  "frameId": {
15967
- "type": "number",
15954
+ "type": "integer",
15968
15955
  "description": "The frame ID associated with the injection."
15969
15956
  },
15970
15957
  "result": {
15971
15958
  "type": "any",
15972
15959
  "optional": true,
15973
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
+ }
15974
15972
  }
15975
15973
  }
15976
15974
  },
@@ -15986,11 +15984,50 @@
15986
15984
  "type": "number"
15987
15985
  }
15988
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
+ },
15989
15992
  "tabId": {
15990
15993
  "type": "number",
15991
15994
  "description": "The ID of the tab into which to inject."
15992
15995
  }
15993
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
+ }
15994
16031
  }
15995
16032
  ],
15996
16033
  "functions": [
@@ -16020,6 +16057,44 @@
16020
16057
  ]
16021
16058
  }
16022
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
+ ]
16023
16098
  }
16024
16099
  ]
16025
16100
  }
@@ -18009,6 +18084,22 @@
18009
18084
  "default": "document_idle",
18010
18085
  "optional": true,
18011
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"
18012
18103
  }
18013
18104
  }
18014
18105
  },