webext-schema 5.5.1 → 5.5.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.
package/package.json CHANGED
@@ -14,30 +14,27 @@
14
14
  "types": "types/index.d.ts",
15
15
  "dependencies": {
16
16
  "camelize": "^1.0.1",
17
- "commander": "^12.1.0",
17
+ "commander": "^13.0.0",
18
18
  "decamelize": "^6.0.0",
19
19
  "json5": "^2.2.3",
20
20
  "sinon": "^19.0.2"
21
21
  },
22
22
  "devDependencies": {
23
23
  "@types/firefox-webext-browser": "^120.0.4",
24
- "@types/node": "^22.10.1",
24
+ "@types/node": "^22.10.5",
25
25
  "@types/sinon": "^17.0.3",
26
- "c8": "^10.1.2",
27
- "eslint": "^9.15.0",
28
- "eslint-plugin-import-x": "^4.4.3",
29
- "eslint-plugin-jsdoc": "^50.6.0",
26
+ "c8": "^10.1.3",
27
+ "eslint": "^9.17.0",
28
+ "eslint-plugin-import-x": "^4.6.1",
29
+ "eslint-plugin-jsdoc": "^50.6.1",
30
30
  "eslint-plugin-regexp": "^2.7.0",
31
31
  "eslint-plugin-unicorn": "^56.0.1",
32
- "globals": "^15.12.0",
33
- "mocha": "^10.8.2",
34
- "neostandard": "^0.11.9",
35
- "npm-run-all2": "^7.0.1",
36
- "typescript": "^5.7.2",
37
- "undici": "^7.0.0"
38
- },
39
- "overrides": {
40
- "glob": "^10.4.5"
32
+ "globals": "^15.14.0",
33
+ "mocha": "^11.0.1",
34
+ "neostandard": "^0.12.0",
35
+ "npm-run-all2": "^7.0.2",
36
+ "typescript": "^5.7.3",
37
+ "undici": "^7.2.0"
41
38
  },
42
39
  "scripts": {
43
40
  "build": "npm run tsc && npm run lint && npm run test",
@@ -57,5 +54,5 @@
57
54
  "update-mail": "node index update --channel=mail -i",
58
55
  "update-release": "node index update --channel=release -i"
59
56
  },
60
- "version": "5.5.1"
57
+ "version": "5.5.2"
61
58
  }
@@ -9590,6 +9590,7 @@
9590
9590
  "imageset",
9591
9591
  "web_manifest",
9592
9592
  "speculative",
9593
+ "json",
9593
9594
  "other"
9594
9595
  ]
9595
9596
  },
@@ -12398,7 +12399,8 @@
12398
12399
  "bandwidth",
12399
12400
  "memory",
12400
12401
  "tracing",
12401
- "sandbox"
12402
+ "sandbox",
12403
+ "flows"
12402
12404
  ]
12403
12405
  },
12404
12406
  {
@@ -20423,6 +20425,7 @@
20423
20425
  "imageset",
20424
20426
  "web_manifest",
20425
20427
  "speculative",
20428
+ "json",
20426
20429
  "other"
20427
20430
  ]
20428
20431
  },
@@ -9590,6 +9590,7 @@
9590
9590
  "imageset",
9591
9591
  "web_manifest",
9592
9592
  "speculative",
9593
+ "json",
9593
9594
  "other"
9594
9595
  ]
9595
9596
  },
@@ -12398,7 +12399,8 @@
12398
12399
  "bandwidth",
12399
12400
  "memory",
12400
12401
  "tracing",
12401
- "sandbox"
12402
+ "sandbox",
12403
+ "flows"
12402
12404
  ]
12403
12405
  },
12404
12406
  {
@@ -20423,6 +20425,7 @@
20423
20425
  "imageset",
20424
20426
  "web_manifest",
20425
20427
  "speculative",
20428
+ "json",
20426
20429
  "other"
20427
20430
  ]
20428
20431
  },
@@ -13066,12 +13066,26 @@
13066
13066
  {
13067
13067
  "id": "MessageAttachment",
13068
13068
  "type": "object",
13069
- "description": "Represents an attachment in a message. This includes all MIME parts with a <em>content-disposition</em> header set to <var>attachment</var>, but also related parts like inline images.",
13069
+ "description": "Represents an attachment in a message.",
13070
13070
  "properties": {
13071
+ "contentDisposition": {
13072
+ "type": "string",
13073
+ "description": "The content disposition of the attachment, for example <var>attachment</var> for normal attachments, or <var>inline</var> for inline attachments."
13074
+ },
13071
13075
  "contentType": {
13072
13076
  "type": "string",
13073
13077
  "description": "The content type of the attachment. A value of <var>text/x-moz-deleted</var> indicates that the original attachment was permanently deleted and replaced by a placeholder text attachment with some meta information about the original attachment."
13074
13078
  },
13079
+ "headers": {
13080
+ "type": "object",
13081
+ "description": "A <em>dictionary object</em> of RFC 2047 decoded attachment headers as <em>key-value</em> pairs, with the header name as <em>key</em>, and an array of headers as <em>value</em>.",
13082
+ "additionalProperties": {
13083
+ "type": "array",
13084
+ "items": {
13085
+ "type": "string"
13086
+ }
13087
+ }
13088
+ },
13075
13089
  "name": {
13076
13090
  "type": "string",
13077
13091
  "description": "The name, as displayed to the user, of this attachment. This is usually but not always the filename of the attached file."
@@ -14383,8 +14397,26 @@
14383
14397
  {
14384
14398
  "namespace": "spaces",
14385
14399
  "types": [
14400
+ {
14401
+ "id": "SpaceTabProperties",
14402
+ "description": "Properties for the new tab being opened by clicking on the associated button in the spaces toolbar.",
14403
+ "type": "object",
14404
+ "properties": {
14405
+ "url": {
14406
+ "type": "string",
14407
+ "optional": true,
14408
+ "description": "The default URL. May point to a WebExtension page or a web page."
14409
+ },
14410
+ "cookieStoreId": {
14411
+ "type": "string",
14412
+ "optional": true,
14413
+ "description": "The <a href='url-cookieStore'>CookieStore</a> id used by the tab. Either a custom id created using the <a href='url-contextualIdentity'>contextualIdentities API</a>, or a built-in one: <var>firefox-default</var>, <var>firefox-container-1</var>, <var>firefox-container-2</var>, <var>firefox-container-3</var>, <var>firefox-container-4</var>, <var>firefox-container-5</var>. **Note:** The naming pattern was deliberately not changed for Thunderbird, but kept for compatibility reasons. The <permission>cookies</permission> permission is required to be able to specify this property. Furthermore, the <permission>contextualIdentities</permission> permission should be requested, to enable the contextual identities feature (enabled by default only on Thunderbird Daily)."
14414
+ }
14415
+ }
14416
+ },
14386
14417
  {
14387
14418
  "id": "SpaceButtonProperties",
14419
+ "description": "Properties of a button in the spaces toolbar.",
14388
14420
  "choices": [
14389
14421
  {
14390
14422
  "max_manifest_version": 2,
@@ -14533,13 +14565,20 @@
14533
14565
  "description": "The name to assign to this space. May only contain alphanumeric characters and underscores. Must be unique for this extension."
14534
14566
  },
14535
14567
  {
14536
- "name": "defaultUrl",
14537
- "type": "string",
14538
- "description": "The default space url, loaded into a tab when the button in the spaces toolbar is clicked. Supported are <var>https://</var> and <var>http://</var> links, as well as links to WebExtension pages."
14568
+ "name": "tabProperties",
14569
+ "choices": [
14570
+ {
14571
+ "$ref": "spaces.SpaceTabProperties"
14572
+ },
14573
+ {
14574
+ "type": "string"
14575
+ }
14576
+ ],
14577
+ "description": "The properties for the new tab being opened, when the associated button in the spaces toolbar is clicked. Either a <em>string</em> specifiying the default URL, or a $(ref:spaces.SpaceTabProperties) object. The URL may point to a WebExtension page or a web page."
14539
14578
  },
14540
14579
  {
14541
14580
  "name": "buttonProperties",
14542
- "description": "Properties of the button for the new space.",
14581
+ "description": "Properties of the button in the spaces toolbar for the new space.",
14543
14582
  "$ref": "spaces.SpaceButtonProperties",
14544
14583
  "optional": true,
14545
14584
  "default": {}
@@ -14674,14 +14713,23 @@
14674
14713
  "minimum": 1
14675
14714
  },
14676
14715
  {
14677
- "name": "defaultUrl",
14678
- "type": "string",
14679
- "description": "The default space url, loaded into a tab when the button in the spaces toolbar is clicked. Supported are <var>https://</var> and <var>http://</var> links, as well as links to WebExtension pages.",
14680
- "optional": true
14716
+ "name": "tabProperties",
14717
+ "choices": [
14718
+ {
14719
+ "type": "string"
14720
+ },
14721
+ {
14722
+ "$ref": "spaces.SpaceTabProperties"
14723
+ },
14724
+ {
14725
+ "$ref": "spaces.SpaceButtonProperties"
14726
+ }
14727
+ ],
14728
+ "description": "The properties for the new tab being opened, when the associated button in the spaces toolbar is clicked. Either a <em>string</em> specifiying the default URL, or a $(ref:spaces.SpaceTabProperties) object. The URL may point to a WebExtension page or a web page."
14681
14729
  },
14682
14730
  {
14683
14731
  "name": "buttonProperties",
14684
- "description": "Only specified button properties will be updated.",
14732
+ "description": "Properties of the button in the spaces toolbar for the specified space Only specified button properties will be updated.",
14685
14733
  "$ref": "spaces.SpaceButtonProperties",
14686
14734
  "optional": true
14687
14735
  }
@@ -15273,7 +15321,7 @@
15273
15321
  "cookieStoreId": {
15274
15322
  "type": "string",
15275
15323
  "optional": true,
15276
- "description": "The <a href='url-cookieStore'>CookieStore</a> id the new tab should use. Either a custom id created using the <a href='url-contextualIdentity'>contextualIdentities API</a>, or a built-in one: <var>firefox-default</var>, <var>firefox-container-1</var>, <var>firefox-container-2</var>, <var>firefox-container-3</var>, <var>firefox-container-4</var>, <var>firefox-container-5</var>. **Note:** The naming pattern was deliberately not changed for Thunderbird, but kept for compatibility reasons."
15324
+ "description": "The <a href='url-cookieStore'>CookieStore</a> id the new tab should use. Either a custom id created using the <a href='url-contextualIdentity'>contextualIdentities API</a>, or a built-in one: <var>firefox-default</var>, <var>firefox-container-1</var>, <var>firefox-container-2</var>, <var>firefox-container-3</var>, <var>firefox-container-4</var>, <var>firefox-container-5</var>. **Note:** The naming pattern was deliberately not changed for Thunderbird, but kept for compatibility reasons. The <permission>cookies</permission> permission is required to be able to specify this property. Furthermore, the <permission>contextualIdentities</permission> permission should be requested, to enable the contextual identities feature (enabled by default only on Thunderbird Daily)."
15277
15325
  },
15278
15326
  "selected": {
15279
15327
  "deprecated": "Please use <var>createProperties.active</var>.",
@@ -16486,7 +16534,7 @@
16486
16534
  "cookieStoreId": {
16487
16535
  "type": "string",
16488
16536
  "optional": true,
16489
- "description": "The CookieStoreId to use for all tabs that were created when the window is opened."
16537
+ "description": "The <a href='url-cookieStore'>CookieStore</a> id which all initially opened tabs should use. Either a custom id created using the <a href='url-contextualIdentity'>contextualIdentities API</a>, or a built-in one: <var>firefox-default</var>, <var>firefox-container-1</var>, <var>firefox-container-2</var>, <var>firefox-container-3</var>, <var>firefox-container-4</var>, <var>firefox-container-5</var>. **Note:** The naming pattern was deliberately not changed for Thunderbird, but kept for compatibility reasons. The <permission>cookies</permission> permission is required to be able to specify this property. Furthermore, the <permission>contextualIdentities</permission> permission should be requested, to enable the contextual identities feature (enabled by default only on Thunderbird Daily)."
16490
16538
  },
16491
16539
  "titlePreface": {
16492
16540
  "type": "string",
@@ -748,54 +748,6 @@
748
748
  "type": "boolean",
749
749
  "optional": true,
750
750
  "description": "Sets the default engine to a built-in engine only."
751
- },
752
- "params": {
753
- "optional": true,
754
- "max_manifest_version": 2,
755
- "type": "array",
756
- "items": {
757
- "type": "object",
758
- "properties": {
759
- "name": {
760
- "type": "string",
761
- "description": "A url parameter name"
762
- },
763
- "condition": {
764
- "type": "string",
765
- "optional": true,
766
- "enum": [
767
- "purpose",
768
- "pref"
769
- ],
770
- "description": "The type of param can be either \"purpose\" or \"pref\"."
771
- },
772
- "pref": {
773
- "type": "string",
774
- "optional": true,
775
- "description": "The preference to retrieve the value from.",
776
- "preprocess": "localize"
777
- },
778
- "purpose": {
779
- "type": "string",
780
- "optional": true,
781
- "enum": [
782
- "contextmenu",
783
- "searchbar",
784
- "homepage",
785
- "keyword",
786
- "newtab"
787
- ],
788
- "description": "The context that initiates a search, required if condition is \"purpose\"."
789
- },
790
- "value": {
791
- "type": "string",
792
- "optional": true,
793
- "description": "A url parameter value.",
794
- "preprocess": "localize"
795
- }
796
- }
797
- },
798
- "description": "A list of optional search url parameters. This allows the additon of search url parameters based on how the search is performed in Firefox."
799
751
  }
800
752
  }
801
753
  }
@@ -12445,7 +12397,8 @@
12445
12397
  "cpufreq",
12446
12398
  "bandwidth",
12447
12399
  "memory",
12448
- "tracing"
12400
+ "tracing",
12401
+ "sandbox"
12449
12402
  ]
12450
12403
  },
12451
12404
  {
@@ -13912,6 +13865,15 @@
13912
13865
  "$ref": "UnrecognizedProperty"
13913
13866
  }
13914
13867
  },
13868
+ {
13869
+ "id": "OptionalOnlyPermission",
13870
+ "choices": [
13871
+ {
13872
+ "type": "string",
13873
+ "enum": []
13874
+ }
13875
+ ]
13876
+ },
13915
13877
  {
13916
13878
  "id": "OptionalPermissionNoPrompt",
13917
13879
  "choices": [
@@ -13946,6 +13908,9 @@
13946
13908
  {
13947
13909
  "$ref": "OptionalPermission"
13948
13910
  },
13911
+ {
13912
+ "$ref": "OptionalOnlyPermission"
13913
+ },
13949
13914
  {
13950
13915
  "$ref": "MatchPattern"
13951
13916
  }
@@ -14419,7 +14384,7 @@
14419
14384
  {
14420
14385
  "name": "getLinkInfo",
14421
14386
  "type": "function",
14422
- "description": "Returns the $(ref:NetworkLinkInfo} of the current network connection.",
14387
+ "description": "Returns the $(ref:NetworkLinkInfo) of the current network connection.",
14423
14388
  "async": true,
14424
14389
  "parameters": []
14425
14390
  }
@@ -15249,7 +15214,14 @@
15249
15214
  "permissions": {
15250
15215
  "type": "array",
15251
15216
  "items": {
15252
- "$ref": "manifest.OptionalPermission"
15217
+ "choices": [
15218
+ {
15219
+ "$ref": "manifest.OptionalPermission"
15220
+ },
15221
+ {
15222
+ "$ref": "manifest.OptionalOnlyPermission"
15223
+ }
15224
+ ]
15253
15225
  },
15254
15226
  "optional": true,
15255
15227
  "default": []
@@ -15271,7 +15243,14 @@
15271
15243
  "permissions": {
15272
15244
  "type": "array",
15273
15245
  "items": {
15274
- "$ref": "manifest.Permission"
15246
+ "choices": [
15247
+ {
15248
+ "$ref": "manifest.Permission"
15249
+ },
15250
+ {
15251
+ "$ref": "manifest.OptionalOnlyPermission"
15252
+ }
15253
+ ]
15275
15254
  },
15276
15255
  "optional": true,
15277
15256
  "default": []
@@ -16048,6 +16027,11 @@
16048
16027
  "type": "string",
16049
16028
  "optional": true,
16050
16029
  "description": "The TLS channel ID of the page or frame that opened the connection, if requested by the extension or app, and if available."
16030
+ },
16031
+ "userScriptWorldId": {
16032
+ "type": "string",
16033
+ "optional": true,
16034
+ "description": "The worldId of the USER_SCRIPT world that sent the message. Only present on onUserScriptMessage and onUserScriptConnect (in port.sender) events."
16051
16035
  }
16052
16036
  }
16053
16037
  },
@@ -16716,6 +16700,20 @@
16716
16700
  }
16717
16701
  ]
16718
16702
  },
16703
+ {
16704
+ "name": "onUserScriptConnect",
16705
+ "type": "function",
16706
+ "description": "Fired when a connection is made from a USER_SCRIPT world registered through the userScripts API.",
16707
+ "permissions": [
16708
+ "userScripts"
16709
+ ],
16710
+ "parameters": [
16711
+ {
16712
+ "$ref": "Port",
16713
+ "name": "port"
16714
+ }
16715
+ ]
16716
+ },
16719
16717
  {
16720
16718
  "name": "onConnectExternal",
16721
16719
  "type": "function",
@@ -16785,6 +16783,36 @@
16785
16783
  "description": "Return true from the event listener if you wish to call <code>sendResponse</code> after the event listener returns."
16786
16784
  }
16787
16785
  },
16786
+ {
16787
+ "name": "onUserScriptMessage",
16788
+ "type": "function",
16789
+ "description": "Fired when a message is sent from a USER_SCRIPT world registered through the userScripts API.",
16790
+ "permissions": [
16791
+ "userScripts"
16792
+ ],
16793
+ "parameters": [
16794
+ {
16795
+ "name": "message",
16796
+ "type": "any",
16797
+ "optional": true,
16798
+ "description": "The message sent by the calling script."
16799
+ },
16800
+ {
16801
+ "name": "sender",
16802
+ "$ref": "MessageSender"
16803
+ },
16804
+ {
16805
+ "name": "sendResponse",
16806
+ "type": "function",
16807
+ "description": "Function to call (at most once) when you have a response. The argument should be any JSON-ifiable object. If you have more than one <code>onMessage</code> listener in the same document, then only one may send a response. This function becomes invalid when the event listener returns, unless you return true from the event listener to indicate you wish to send a response asynchronously (this will keep the message channel open to the other end until <code>sendResponse</code> is called)."
16808
+ }
16809
+ ],
16810
+ "returns": {
16811
+ "type": "boolean",
16812
+ "optional": true,
16813
+ "description": "Return true from the event listener if you wish to call <code>sendResponse</code> after the event listener returns."
16814
+ }
16815
+ },
16788
16816
  {
16789
16817
  "name": "onRestartRequired",
16790
16818
  "unsupported": true,
@@ -17874,6 +17902,7 @@
17874
17902
  },
17875
17903
  {
17876
17904
  "name": "scalarAdd",
17905
+ "deprecated": "`scalarAdd` is a no-op since Firefox 134 (see bug 1930196)",
17877
17906
  "type": "function",
17878
17907
  "description": "Adds the value to the given scalar.",
17879
17908
  "async": true,
@@ -17893,6 +17922,7 @@
17893
17922
  },
17894
17923
  {
17895
17924
  "name": "scalarSet",
17925
+ "deprecated": "`scalarSet` is a no-op since Firefox 134 (see bug 1930196)",
17896
17926
  "type": "function",
17897
17927
  "description": "Sets the named scalar to the given value. Throws if the value type doesn't match the scalar type.",
17898
17928
  "async": true,
@@ -17927,6 +17957,7 @@
17927
17957
  },
17928
17958
  {
17929
17959
  "name": "scalarSetMaximum",
17960
+ "deprecated": "`scalarSetMaximum` is a no-op since Firefox 134 (see bug 1930196)",
17930
17961
  "type": "function",
17931
17962
  "description": "Sets the scalar to the maximum of the current and the passed value",
17932
17963
  "async": true,
@@ -17946,6 +17977,7 @@
17946
17977
  },
17947
17978
  {
17948
17979
  "name": "keyedScalarAdd",
17980
+ "deprecated": "`keyedScalarAdd` is a no-op since Firefox 134 (see bug 1930196)",
17949
17981
  "type": "function",
17950
17982
  "description": "Adds the value to the given keyed scalar.",
17951
17983
  "async": true,
@@ -17970,6 +18002,7 @@
17970
18002
  },
17971
18003
  {
17972
18004
  "name": "keyedScalarSet",
18005
+ "deprecated": "`keyedScalarSet` is a no-op since Firefox 134 (see bug 1930196)",
17973
18006
  "type": "function",
17974
18007
  "description": "Sets the keyed scalar to the given value. Throws if the value type doesn't match the scalar type.",
17975
18008
  "async": true,
@@ -18009,6 +18042,7 @@
18009
18042
  },
18010
18043
  {
18011
18044
  "name": "keyedScalarSetMaximum",
18045
+ "deprecated": "`keyedScalarSetMaximum` is a no-op since Firefox 134 (see bug 1930196)",
18012
18046
  "type": "function",
18013
18047
  "description": "Sets the keyed scalar to the maximum of the current and the passed value",
18014
18048
  "async": true,
@@ -18072,6 +18106,7 @@
18072
18106
  },
18073
18107
  {
18074
18108
  "name": "registerScalars",
18109
+ "deprecated": "`registerScalars` is a no-op since Firefox 134 (see bug 1930196)",
18075
18110
  "type": "function",
18076
18111
  "description": "Register new scalars to record them from addons. See nsITelemetry.idl for more details.",
18077
18112
  "async": true,
@@ -18939,6 +18974,110 @@
18939
18974
  ]
18940
18975
  }
18941
18976
  ],
18977
+ "trial_ml.json": [
18978
+ {
18979
+ "namespace": "manifest",
18980
+ "types": [
18981
+ {
18982
+ "$extend": "OptionalOnlyPermission",
18983
+ "choices": [
18984
+ {
18985
+ "type": "string",
18986
+ "enum": [
18987
+ "trialML"
18988
+ ]
18989
+ }
18990
+ ]
18991
+ }
18992
+ ]
18993
+ },
18994
+ {
18995
+ "namespace": "trial",
18996
+ "allowedContexts": [
18997
+ "content"
18998
+ ],
18999
+ "permissions": [
19000
+ "trialML"
19001
+ ]
19002
+ },
19003
+ {
19004
+ "namespace": "trial.ml",
19005
+ "description": "Use the trial ML API to run Machine Learning models requests from extensions pages or content scripts.",
19006
+ "allowedContexts": [
19007
+ "content"
19008
+ ],
19009
+ "permissions": [
19010
+ "trialML"
19011
+ ],
19012
+ "events": [
19013
+ {
19014
+ "name": "onProgress",
19015
+ "type": "function",
19016
+ "allowedContexts": [
19017
+ "content"
19018
+ ],
19019
+ "description": "Events from the inference engine.",
19020
+ "parameters": [
19021
+ {
19022
+ "name": "progressData",
19023
+ "description": "Object containing the data, see https://firefox-source-docs.mozilla.org/toolkit/components/ml/notifications.html",
19024
+ "type": "object"
19025
+ }
19026
+ ]
19027
+ }
19028
+ ],
19029
+ "types": [
19030
+ {
19031
+ "id": "CreateEngineRequest",
19032
+ "type": "object",
19033
+ "additionalProperties": true
19034
+ },
19035
+ {
19036
+ "id": "RunEngineRequest",
19037
+ "type": "object",
19038
+ "additionalProperties": true
19039
+ }
19040
+ ],
19041
+ "functions": [
19042
+ {
19043
+ "name": "createEngine",
19044
+ "type": "function",
19045
+ "description": "Prepare the inference engine",
19046
+ "async": true,
19047
+ "parameters": [
19048
+ {
19049
+ "name": "CreateEngineRequest",
19050
+ "$ref": "CreateEngineRequest"
19051
+ }
19052
+ ]
19053
+ },
19054
+ {
19055
+ "name": "runEngine",
19056
+ "type": "function",
19057
+ "allowedContexts": [
19058
+ "content"
19059
+ ],
19060
+ "description": "Call the inference engine",
19061
+ "async": true,
19062
+ "parameters": [
19063
+ {
19064
+ "name": "RunEngineRequest",
19065
+ "$ref": "RunEngineRequest"
19066
+ }
19067
+ ]
19068
+ },
19069
+ {
19070
+ "name": "deleteCachedModels",
19071
+ "type": "function",
19072
+ "allowedContexts": [
19073
+ "content"
19074
+ ],
19075
+ "description": "Delete the models the extension downloaded.",
19076
+ "async": true
19077
+ }
19078
+ ]
19079
+ }
19080
+ ],
18942
19081
  "types.json": [
18943
19082
  {
18944
19083
  "namespace": "types",
@@ -19111,6 +19250,17 @@
19111
19250
  {
19112
19251
  "namespace": "manifest",
19113
19252
  "types": [
19253
+ {
19254
+ "$extend": "OptionalOnlyPermission",
19255
+ "choices": [
19256
+ {
19257
+ "type": "string",
19258
+ "enum": [
19259
+ "userScripts"
19260
+ ]
19261
+ }
19262
+ ]
19263
+ },
19114
19264
  {
19115
19265
  "$extend": "WebExtensionManifest",
19116
19266
  "properties": {
@@ -19134,13 +19284,14 @@
19134
19284
  },
19135
19285
  {
19136
19286
  "namespace": "userScripts",
19137
- "max_manifest_version": 2,
19138
19287
  "permissions": [
19139
- "manifest:user_scripts"
19288
+ "manifest:user_scripts",
19289
+ "userScripts"
19140
19290
  ],
19141
19291
  "types": [
19142
19292
  {
19143
19293
  "id": "UserScriptOptions",
19294
+ "max_manifest_version": 2,
19144
19295
  "type": "object",
19145
19296
  "description": "Details of a user script",
19146
19297
  "properties": {
@@ -19226,29 +19377,322 @@
19226
19377
  },
19227
19378
  {
19228
19379
  "id": "RegisteredUserScript",
19380
+ "min_manifest_version": 3,
19229
19381
  "type": "object",
19230
19382
  "description": "An object that represents a user script registered programmatically",
19231
- "functions": [
19383
+ "properties": {
19384
+ "id": {
19385
+ "type": "string",
19386
+ "optional": false,
19387
+ "description": "The ID of the user script specified in the API call. This property must not start with a '_' as it's reserved as a prefix for generated script IDs."
19388
+ },
19389
+ "allFrames": {
19390
+ "type": "boolean",
19391
+ "optional": true,
19392
+ "description": "If allFrames is <code>true</code>, implies that the JavaScript should be injected into all frames of current page. By default, it's <code>false</code> and is only injected into the top frame."
19393
+ },
19394
+ "js": {
19395
+ "type": "array",
19396
+ "optional": false,
19397
+ "description": "The list of ScriptSource objects defining sources of scripts to be injected into matching pages.",
19398
+ "items": {
19399
+ "$ref": "ScriptSource"
19400
+ }
19401
+ },
19402
+ "matches": {
19403
+ "type": "array",
19404
+ "optional": true,
19405
+ "description": "At least one of matches or includeGlobs should be non-empty. The script runs in documents whose URL match either pattern.",
19406
+ "items": {
19407
+ "$ref": "manifest.MatchPattern"
19408
+ }
19409
+ },
19410
+ "excludeMatches": {
19411
+ "type": "array",
19412
+ "optional": true,
19413
+ "items": {
19414
+ "$ref": "manifest.MatchPattern"
19415
+ }
19416
+ },
19417
+ "includeGlobs": {
19418
+ "type": "array",
19419
+ "optional": true,
19420
+ "description": "At least one of matches or includeGlobs should be non-empty. The script runs in documents whose URL match either pattern.",
19421
+ "items": {
19422
+ "type": "string"
19423
+ }
19424
+ },
19425
+ "excludeGlobs": {
19426
+ "type": "array",
19427
+ "optional": true,
19428
+ "items": {
19429
+ "type": "string"
19430
+ }
19431
+ },
19432
+ "runAt": {
19433
+ "$ref": "extensionTypes.RunAt",
19434
+ "optional": true,
19435
+ "description": "The soonest that the JavaScript will be injected into the tab. Defaults to \"document_idle\"."
19436
+ },
19437
+ "world": {
19438
+ "$ref": "ExecutionWorld",
19439
+ "optional": true,
19440
+ "description": "The JavaScript script for a script to execute within. Defaults to \"USER_SCRIPT\"."
19441
+ },
19442
+ "worldId": {
19443
+ "type": "string",
19444
+ "optional": true,
19445
+ "description": "If specified, specifies a specific user script world ID to execute in. Only valid if `world` is omitted or is `USER_SCRIPT`. If `worldId` is omitted, the script will execute in the default user script world (\"\"). Values with leading underscores (`_`) are reserved. The maximum length is 256."
19446
+ }
19447
+ }
19448
+ },
19449
+ {
19450
+ "id": "ExecutionWorld",
19451
+ "min_manifest_version": 3,
19452
+ "type": "string",
19453
+ "enum": [
19454
+ "MAIN",
19455
+ "USER_SCRIPT"
19456
+ ],
19457
+ "description": "The JavaScript world for a script to execute within. <code>USER_SCRIPT</code> is the default execution environment of user scripts, <code>MAIN</code> is the web page's execution environment."
19458
+ },
19459
+ {
19460
+ "id": "UserScriptFilter",
19461
+ "min_manifest_version": 3,
19462
+ "type": "object",
19463
+ "description": "Optional filter to use with getScripts() and unregister().",
19464
+ "properties": {
19465
+ "ids": {
19466
+ "type": "array",
19467
+ "optional": true,
19468
+ "items": {
19469
+ "type": "string"
19470
+ }
19471
+ }
19472
+ }
19473
+ },
19474
+ {
19475
+ "id": "ScriptSource",
19476
+ "min_manifest_version": 3,
19477
+ "description": "Object with file xor code property. Equivalent to the ExtensionFileOrCode, except the file remains a relative URL.",
19478
+ "choices": [
19232
19479
  {
19233
- "name": "unregister",
19234
- "type": "function",
19235
- "description": "Unregister a user script registered programmatically",
19236
- "async": true,
19237
- "parameters": []
19480
+ "type": "object",
19481
+ "properties": {
19482
+ "file": {
19483
+ "type": "string",
19484
+ "description": "The path of the JavaScript file to inject relative to the extension's root directory.",
19485
+ "format": "unresolvedRelativeUrl"
19486
+ }
19487
+ }
19488
+ },
19489
+ {
19490
+ "type": "object",
19491
+ "properties": {
19492
+ "code": {
19493
+ "type": "string"
19494
+ }
19495
+ }
19238
19496
  }
19239
19497
  ]
19498
+ },
19499
+ {
19500
+ "id": "WorldProperties",
19501
+ "min_manifest_version": 3,
19502
+ "type": "object",
19503
+ "description": "The configuration of a USER_SCRIPT world.",
19504
+ "properties": {
19505
+ "worldId": {
19506
+ "type": "string",
19507
+ "optional": true,
19508
+ "default": "",
19509
+ "description": "The identifier of the world. Values with leading underscores (`_`) are reserved. The maximum length is 256. Defaults to the default USER_SCRIPT world (\"\")."
19510
+ },
19511
+ "csp": {
19512
+ "type": "string",
19513
+ "optional": true,
19514
+ "description": "The world's Content Security Policy. Defaults to the CSP of regular content scripts, which prohibits dynamic code execution such as eval."
19515
+ },
19516
+ "messaging": {
19517
+ "type": "boolean",
19518
+ "optional": true,
19519
+ "default": false,
19520
+ "description": "Whether the runtime.sendMessage and runtime.connect methods are exposed. Defaults to not exposing these messaging APIs."
19521
+ }
19522
+ }
19240
19523
  }
19241
19524
  ],
19242
19525
  "functions": [
19243
19526
  {
19244
19527
  "name": "register",
19528
+ "max_manifest_version": 2,
19245
19529
  "type": "function",
19246
- "description": "Register a user script programmatically given its $(ref:userScripts.UserScriptOptions), and resolves to a $(ref:userScripts.RegisteredUserScript) instance",
19247
- "async": true,
19530
+ "description": "Register a user script programmatically given its $(ref:userScripts.UserScriptOptions), and resolves to an object with the unregister() function",
19531
+ "async": "callback",
19248
19532
  "parameters": [
19249
19533
  {
19250
19534
  "name": "userScriptOptions",
19251
19535
  "$ref": "UserScriptOptions"
19536
+ },
19537
+ {
19538
+ "name": "callback",
19539
+ "type": "function",
19540
+ "parameters": [
19541
+ {
19542
+ "name": "legacyRegisteredUserScript",
19543
+ "type": "object",
19544
+ "description": "An object that represents a user script registered programmatically",
19545
+ "properties": {
19546
+ "unregister": {
19547
+ "type": "function",
19548
+ "description": "Unregister a user script registered programmatically",
19549
+ "async": true,
19550
+ "parameters": []
19551
+ }
19552
+ }
19553
+ }
19554
+ ]
19555
+ }
19556
+ ]
19557
+ },
19558
+ {
19559
+ "name": "register",
19560
+ "min_manifest_version": 3,
19561
+ "type": "function",
19562
+ "description": "Registers one or more user scripts for this extension.",
19563
+ "async": true,
19564
+ "parameters": [
19565
+ {
19566
+ "name": "scripts",
19567
+ "type": "array",
19568
+ "items": {
19569
+ "$ref": "RegisteredUserScript"
19570
+ },
19571
+ "description": "List of user scripts to be registered."
19572
+ }
19573
+ ]
19574
+ },
19575
+ {
19576
+ "name": "update",
19577
+ "min_manifest_version": 3,
19578
+ "type": "function",
19579
+ "description": "Updates one or more user scripts for this extension.",
19580
+ "async": true,
19581
+ "parameters": [
19582
+ {
19583
+ "name": "scripts",
19584
+ "type": "array",
19585
+ "items": {
19586
+ "type": "object",
19587
+ "$import": "RegisteredUserScript",
19588
+ "properties": {
19589
+ "js": {
19590
+ "type": "array",
19591
+ "optional": true,
19592
+ "items": {
19593
+ "$ref": "ScriptSource"
19594
+ }
19595
+ }
19596
+ }
19597
+ },
19598
+ "description": "List of user scripts to be updated."
19599
+ }
19600
+ ]
19601
+ },
19602
+ {
19603
+ "name": "unregister",
19604
+ "min_manifest_version": 3,
19605
+ "type": "function",
19606
+ "description": "Unregisters all dynamically-registered user scripts for this extension.",
19607
+ "async": true,
19608
+ "parameters": [
19609
+ {
19610
+ "name": "filter",
19611
+ "$ref": "UserScriptFilter",
19612
+ "optional": true,
19613
+ "description": "If specified, this method unregisters only the user scripts that match it."
19614
+ }
19615
+ ]
19616
+ },
19617
+ {
19618
+ "name": "getScripts",
19619
+ "min_manifest_version": 3,
19620
+ "type": "function",
19621
+ "description": "Returns all dynamically-registered user scripts for this extension.",
19622
+ "async": "callback",
19623
+ "parameters": [
19624
+ {
19625
+ "name": "filter",
19626
+ "$ref": "UserScriptFilter",
19627
+ "optional": true,
19628
+ "description": "If specified, this method returns only the user scripts that match it."
19629
+ },
19630
+ {
19631
+ "name": "callback",
19632
+ "type": "function",
19633
+ "parameters": [
19634
+ {
19635
+ "name": "scripts",
19636
+ "type": "array",
19637
+ "items": {
19638
+ "$ref": "RegisteredUserScript"
19639
+ },
19640
+ "description": "List of registered user scripts."
19641
+ }
19642
+ ]
19643
+ }
19644
+ ]
19645
+ },
19646
+ {
19647
+ "name": "configureWorld",
19648
+ "min_manifest_version": 3,
19649
+ "type": "function",
19650
+ "description": "Configures the environment for scripts running in a USER_SCRIPT world.",
19651
+ "async": true,
19652
+ "parameters": [
19653
+ {
19654
+ "name": "properties",
19655
+ "$ref": "WorldProperties",
19656
+ "description": "The desired configuration for a USER_SCRIPT world."
19657
+ }
19658
+ ]
19659
+ },
19660
+ {
19661
+ "name": "resetWorldConfiguration",
19662
+ "min_manifest_version": 3,
19663
+ "type": "function",
19664
+ "description": "Resets the configuration for a given world. That world will fall back to the default world's configuration.",
19665
+ "async": true,
19666
+ "parameters": [
19667
+ {
19668
+ "name": "worldId",
19669
+ "type": "string",
19670
+ "optional": true,
19671
+ "default": "",
19672
+ "description": "The ID of the USER_SCRIPT world to reset. If omitted or empty, resets the default world's configuration."
19673
+ }
19674
+ ]
19675
+ },
19676
+ {
19677
+ "name": "getWorldConfigurations",
19678
+ "min_manifest_version": 3,
19679
+ "type": "function",
19680
+ "description": "Returns all registered USER_SCRIPT world configurations.",
19681
+ "async": "callback",
19682
+ "parameters": [
19683
+ {
19684
+ "name": "callback",
19685
+ "type": "function",
19686
+ "parameters": [
19687
+ {
19688
+ "name": "configurations",
19689
+ "type": "array",
19690
+ "items": {
19691
+ "$ref": "WorldProperties"
19692
+ },
19693
+ "description": "All configurations registered with configureWorld()."
19694
+ }
19695
+ ]
19252
19696
  }
19253
19697
  ]
19254
19698
  }
@@ -19258,9 +19702,9 @@
19258
19702
  "user_scripts_content.json": [
19259
19703
  {
19260
19704
  "namespace": "userScripts",
19261
- "max_manifest_version": 2,
19262
19705
  "permissions": [
19263
- "manifest:user_scripts"
19706
+ "manifest:user_scripts",
19707
+ "userScripts"
19264
19708
  ],
19265
19709
  "allowedContexts": [
19266
19710
  "content"
@@ -19268,6 +19712,7 @@
19268
19712
  "events": [
19269
19713
  {
19270
19714
  "name": "onBeforeScript",
19715
+ "max_manifest_version": 2,
19271
19716
  "permissions": [
19272
19717
  "manifest:user_scripts.api_script"
19273
19718
  ],