webext-schema 5.0.4 → 5.0.6

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
@@ -28,25 +28,25 @@
28
28
  "update-release": "node index update --channel=release -i"
29
29
  },
30
30
  "dependencies": {
31
- "camelize": "^1.0.0",
32
- "commander": "^9.4.0",
31
+ "camelize": "^1.0.1",
32
+ "commander": "^9.4.1",
33
33
  "decamelize": "^6.0.0",
34
34
  "json5": "^2.2.1",
35
35
  "node-fetch": "^3.2.10",
36
- "sinon": "^14.0.0"
36
+ "sinon": "^14.0.1"
37
37
  },
38
38
  "devDependencies": {
39
39
  "c8": "^7.12.0",
40
40
  "chai": "^4.3.6",
41
- "eslint": "^8.24.0",
41
+ "eslint": "^8.25.0",
42
42
  "eslint-config-standard": "^17.0.0",
43
43
  "eslint-plugin-import": "^2.26.0",
44
- "eslint-plugin-jsdoc": "^39.3.6",
44
+ "eslint-plugin-jsdoc": "^39.3.14",
45
45
  "eslint-plugin-node": "^11.1.0",
46
- "eslint-plugin-promise": "^6.0.1",
47
- "mocha": "^10.0.0",
46
+ "eslint-plugin-promise": "^6.1.0",
47
+ "mocha": "^10.1.0",
48
48
  "nock": "^13.2.9",
49
49
  "npm-run-all": "^4.1.5"
50
50
  },
51
- "version": "5.0.4"
51
+ "version": "5.0.6"
52
52
  }
@@ -16262,15 +16262,9 @@
16262
16262
  "description": "The result of the script execution."
16263
16263
  },
16264
16264
  "error": {
16265
- "type": "object",
16265
+ "type": "any",
16266
16266
  "optional": true,
16267
- "description": "When the injection has failed, the error is exposed to the caller with this property.",
16268
- "properties": {
16269
- "message": {
16270
- "type": "string",
16271
- "description": "A message explaining why the injection has failed."
16272
- }
16273
- }
16267
+ "description": "The error property is set when the script execution failed. The value is typically an (Error) object with a message property, but could be any value (including primitives and undefined) if the script threw or rejected with such a value."
16274
16268
  }
16275
16269
  }
16276
16270
  },
@@ -13076,7 +13076,8 @@
13076
13076
  },
13077
13077
  "version": {
13078
13078
  "type": "string",
13079
- "optional": false
13079
+ "optional": false,
13080
+ "format": "versionString"
13080
13081
  },
13081
13082
  "homepage_url": {
13082
13083
  "type": "string",
@@ -16262,15 +16263,9 @@
16262
16263
  "description": "The result of the script execution."
16263
16264
  },
16264
16265
  "error": {
16265
- "type": "object",
16266
+ "type": "any",
16266
16267
  "optional": true,
16267
- "description": "When the injection has failed, the error is exposed to the caller with this property.",
16268
- "properties": {
16269
- "message": {
16270
- "type": "string",
16271
- "description": "A message explaining why the injection has failed."
16272
- }
16273
- }
16268
+ "description": "The error property is set when the script execution failed. The value is typically an (Error) object with a message property, but could be any value (including primitives and undefined) if the script threw or rejected with such a value."
16274
16269
  }
16275
16270
  }
16276
16271
  },
@@ -3592,6 +3592,24 @@
3592
3592
  ],
3593
3593
  "description": "Gets the photo associated with this contact, if any."
3594
3594
  },
3595
+ {
3596
+ "name": "setPhoto",
3597
+ "type": "function",
3598
+ "async": true,
3599
+ "parameters": [
3600
+ {
3601
+ "name": "id",
3602
+ "type": "string"
3603
+ },
3604
+ {
3605
+ "name": "file",
3606
+ "type": "object",
3607
+ "isInstanceOf": "File",
3608
+ "additionalProperties": true
3609
+ }
3610
+ ],
3611
+ "description": "Sets the photo associated with this contact."
3612
+ },
3595
3613
  {
3596
3614
  "name": "create",
3597
3615
  "type": "function",
@@ -4327,19 +4345,12 @@
4327
4345
  }
4328
4346
  ],
4329
4347
  "optional": true,
4330
- "description": "Either an ImageDataType object defining a single icon used for all sizes or an ImageDataDictionary object defining dedicated icons for different sizes."
4348
+ "description": "Either an ImageDataType object defining a single icon used for all sizes or an ImageDataDictionary 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."
4331
4349
  },
4332
4350
  "path": {
4333
- "choices": [
4334
- {
4335
- "type": "string"
4336
- },
4337
- {
4338
- "$ref": "manifest.IconPath"
4339
- }
4340
- ],
4351
+ "$ref": "manifest.IconPath",
4341
4352
  "optional": true,
4342
- "description": "Either a relative image path defining a single icon used for all sizes or an IconPathDictionary object defining dedicated icons for different sizes."
4353
+ "description": "The icon for the action."
4343
4354
  }
4344
4355
  }
4345
4356
  },
@@ -6377,7 +6388,7 @@
6377
6388
  },
6378
6389
  "default_icon": {
6379
6390
  "$ref": "IconPath",
6380
- "description": "The icon for the messageDisplayAction.",
6391
+ "description": "The icon for the composeAction.",
6381
6392
  "optional": true
6382
6393
  },
6383
6394
  "theme_icons": {
@@ -6633,19 +6644,12 @@
6633
6644
  }
6634
6645
  ],
6635
6646
  "optional": true,
6636
- "description": "Either an ImageDataType object defining a single icon used for all sizes or an ImageDataDictionary object defining dedicated icons for different sizes."
6647
+ "description": "Either an ImageDataType object defining a single icon used for all sizes or an ImageDataDictionary 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."
6637
6648
  },
6638
6649
  "path": {
6639
- "choices": [
6640
- {
6641
- "type": "string"
6642
- },
6643
- {
6644
- "$ref": "manifest.IconPath"
6645
- }
6646
- ],
6650
+ "$ref": "manifest.IconPath",
6647
6651
  "optional": true,
6648
- "description": "Either a relative image path defining a single icon used for all sizes or an IconPathDictionary object defining dedicated icons for different sizes."
6652
+ "description": "The icon for the composeAction."
6649
6653
  }
6650
6654
  }
6651
6655
  },
@@ -8619,13 +8623,9 @@
8619
8623
  "description": "The unique ID to assign to this item. Mandatory for event pages. Cannot be the same as another ID for this extension."
8620
8624
  },
8621
8625
  "icons": {
8622
- "type": "object",
8626
+ "$ref": "manifest.IconPath",
8623
8627
  "optional": true,
8624
- "patternProperties": {
8625
- "^[1-9]\\d*$": {
8626
- "type": "string"
8627
- }
8628
- }
8628
+ "description": "Custom icons to display next to the menu item. Custom icons can only be set for items appearing in submenus."
8629
8629
  },
8630
8630
  "title": {
8631
8631
  "type": "string",
@@ -8754,13 +8754,8 @@
8754
8754
  "optional": true
8755
8755
  },
8756
8756
  "icons": {
8757
- "type": "object",
8758
- "optional": "omit-key-if-missing",
8759
- "patternProperties": {
8760
- "^[1-9]\\d*$": {
8761
- "type": "string"
8762
- }
8763
- }
8757
+ "$ref": "manifest.IconPath",
8758
+ "optional": "omit-key-if-missing"
8764
8759
  },
8765
8760
  "title": {
8766
8761
  "type": "string",
@@ -9453,19 +9448,12 @@
9453
9448
  }
9454
9449
  ],
9455
9450
  "optional": true,
9456
- "description": "Either an ImageDataType object defining a single icon used for all sizes or an ImageDataDictionary object defining dedicated icons for different sizes."
9451
+ "description": "Either an ImageDataType object defining a single icon used for all sizes or an ImageDataDictionary 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."
9457
9452
  },
9458
9453
  "path": {
9459
- "choices": [
9460
- {
9461
- "type": "string"
9462
- },
9463
- {
9464
- "$ref": "manifest.IconPath"
9465
- }
9466
- ],
9454
+ "$ref": "manifest.IconPath",
9467
9455
  "optional": true,
9468
- "description": "Either a relative image path defining a single icon used for all sizes or an IconPathDictionary object defining dedicated icons for different sizes."
9456
+ "description": "The icon for the messageDisplayAction."
9469
9457
  }
9470
9458
  }
9471
9459
  },
@@ -10679,7 +10667,7 @@
10679
10667
  }
10680
10668
  ],
10681
10669
  "optional": true,
10682
- "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."
10670
+ "description": "The icon for the button in the spaces toolbar. Defaults to the extension icon, if set to an empty string."
10683
10671
  },
10684
10672
  "themeIcons": {
10685
10673
  "type": "array",
@@ -9699,9 +9699,297 @@
9699
9699
  "description": "ID of the Ruleset this rule belongs to."
9700
9700
  }
9701
9701
  }
9702
+ },
9703
+ {
9704
+ "id": "Rule",
9705
+ "type": "object",
9706
+ "properties": {
9707
+ "id": {
9708
+ "type": "integer",
9709
+ "description": "An id which uniquely identifies a rule. Mandatory and should be >= 1.",
9710
+ "minimum": 1
9711
+ },
9712
+ "priority": {
9713
+ "type": "integer",
9714
+ "optional": true,
9715
+ "description": "Rule priority. Defaults to 1. When specified, should be >= 1",
9716
+ "minimum": 1,
9717
+ "default": 1
9718
+ },
9719
+ "condition": {
9720
+ "type": "object",
9721
+ "description": "The condition under which this rule is triggered.",
9722
+ "properties": {
9723
+ "urlFilter": {
9724
+ "type": "string",
9725
+ "optional": true,
9726
+ "description": "TODO: link to doc explaining supported pattern. The pattern which is matched against the network request url. Only one of 'urlFilter' or 'regexFilter' can be specified."
9727
+ },
9728
+ "regexFilter": {
9729
+ "type": "string",
9730
+ "optional": true,
9731
+ "description": "Regular expression to match against the network request url. Only one of 'urlFilter' or 'regexFilter' can be specified."
9732
+ },
9733
+ "isUrlFilterCaseSensitive": {
9734
+ "type": "boolean",
9735
+ "optional": true,
9736
+ "description": "Whether 'urlFilter' or 'regexFilter' is case-sensitive. Defaults to true."
9737
+ },
9738
+ "initiatorDomains": {
9739
+ "type": "array",
9740
+ "optional": true,
9741
+ "description": "The rule will only match network requests originating from the list of 'initiatorDomains'. If the list is omitted, the rule is applied to requests from all domains.",
9742
+ "minItems": 1,
9743
+ "items": {
9744
+ "type": "string",
9745
+ "description": "TODO: describe domain format."
9746
+ }
9747
+ },
9748
+ "excludedInitiatorDomains": {
9749
+ "type": "array",
9750
+ "optional": true,
9751
+ "description": "The rule will not match network requests originating from the list of 'initiatorDomains'. If the list is empty or omitted, no domains are excluded. This takes precedence over 'initiatorDomains'.",
9752
+ "items": {
9753
+ "type": "string",
9754
+ "description": "TODO: describe domain format."
9755
+ }
9756
+ },
9757
+ "requestDomains": {
9758
+ "type": "array",
9759
+ "optional": true,
9760
+ "description": "The rule will only match network requests when the domain matches one from the list of 'requestDomains'. If the list is omitted, the rule is applied to requests from all domains.",
9761
+ "minItems": 1,
9762
+ "items": {
9763
+ "type": "string",
9764
+ "description": "TODO: describe domain format."
9765
+ }
9766
+ },
9767
+ "excludedRequestDomains": {
9768
+ "type": "array",
9769
+ "optional": true,
9770
+ "description": "The rule will not match network requests when the domains matches one from the list of 'excludedRequestDomains'. If the list is empty or omitted, no domains are excluded. This takes precedence over 'requestDomains'.",
9771
+ "items": {
9772
+ "type": "string",
9773
+ "description": "TODO: describe domain format."
9774
+ }
9775
+ },
9776
+ "resourceTypes": {
9777
+ "type": "array",
9778
+ "optional": true,
9779
+ "description": "List of resource types which the rule can match. When the rule action is 'allowAllRequests', this must be specified and may only contain 'main_frame' or 'sub_frame'. Cannot be specified if 'excludedResourceTypes' is specified. If neither of them is specified, all resource types except 'main_frame' are matched.",
9780
+ "minItems": 1,
9781
+ "items": {
9782
+ "$ref": "ResourceType"
9783
+ }
9784
+ },
9785
+ "excludedResourceTypes": {
9786
+ "type": "array",
9787
+ "optional": true,
9788
+ "description": "List of resource types which the rule won't match. Cannot be specified if 'resourceTypes' is specified. If neither of them is specified, all resource types except 'main_frame' are matched.",
9789
+ "minItems": 1,
9790
+ "items": {
9791
+ "$ref": "ResourceType"
9792
+ }
9793
+ },
9794
+ "requestMethods": {
9795
+ "type": "array",
9796
+ "optional": true,
9797
+ "description": "List of HTTP request methods which the rule can match. Should be a lower-case method such as 'connect', 'delete', 'get', 'head', 'options', 'patch', 'post', 'put'.'",
9798
+ "minItems": 1,
9799
+ "items": {
9800
+ "type": "string"
9801
+ }
9802
+ },
9803
+ "excludedRequestMethods": {
9804
+ "type": "array",
9805
+ "optional": true,
9806
+ "description": "List of request methods which the rule won't match. Cannot be specified if 'requestMethods' is specified. If neither of them is specified, all request methods are matched.",
9807
+ "minItems": 1,
9808
+ "items": {
9809
+ "type": "string"
9810
+ }
9811
+ },
9812
+ "domainType": {
9813
+ "type": "string",
9814
+ "optional": true,
9815
+ "description": "Specifies whether the network request is first-party or third-party to the domain from which it originated. If omitted, all requests are matched.",
9816
+ "enum": [
9817
+ "firstParty",
9818
+ "thirdParty"
9819
+ ]
9820
+ },
9821
+ "tabIds": {
9822
+ "type": "array",
9823
+ "optional": true,
9824
+ "description": "List of tabIds which the rule should match. An ID of -1 matches requests which don't originate from a tab. Only supported for session-scoped rules.",
9825
+ "minItems": 1,
9826
+ "items": {
9827
+ "type": "integer"
9828
+ }
9829
+ },
9830
+ "excludedTabIds": {
9831
+ "type": "array",
9832
+ "optional": true,
9833
+ "description": "List of tabIds which the rule should not match. An ID of -1 excludes requests which don't originate from a tab. Only supported for session-scoped rules.",
9834
+ "items": {
9835
+ "type": "integer"
9836
+ }
9837
+ }
9838
+ }
9839
+ },
9840
+ "action": {
9841
+ "type": "object",
9842
+ "description": "The action to take if this rule is matched.",
9843
+ "properties": {
9844
+ "type": {
9845
+ "type": "string",
9846
+ "enum": [
9847
+ "block",
9848
+ "redirect",
9849
+ "allow",
9850
+ "upgradeScheme",
9851
+ "modifyHeaders",
9852
+ "allowAllRequests"
9853
+ ]
9854
+ },
9855
+ "redirect": {
9856
+ "type": "object",
9857
+ "optional": true,
9858
+ "description": "Describes how the redirect should be performed. Only valid when type is 'redirect'.",
9859
+ "properties": {
9860
+ "extensionPath": {
9861
+ "type": "string",
9862
+ "optional": true,
9863
+ "description": "Path relative to the extension directory. Should start with '/'."
9864
+ },
9865
+ "transform": {
9866
+ "type": "object",
9867
+ "optional": true,
9868
+ "description": "TODO: URLTransform - Url transformations to perform."
9869
+ },
9870
+ "url": {
9871
+ "type": "string",
9872
+ "optional": true,
9873
+ "description": "The redirect url. Redirects to JavaScript urls are not allowed."
9874
+ },
9875
+ "regexSubstitution": {
9876
+ "type": "string",
9877
+ "optional": true,
9878
+ "description": "TODO with regexFilter + Substitution pattern for rules which specify a 'regexFilter'."
9879
+ }
9880
+ }
9881
+ },
9882
+ "requestHeaders": {
9883
+ "type": "object",
9884
+ "optional": true,
9885
+ "description": "The request headers to modify for the request. Only valid when type is 'modifyHeaders'.",
9886
+ "properties": {
9887
+ "header": {
9888
+ "type": "string",
9889
+ "description": "The name of the request header to be modified."
9890
+ },
9891
+ "operation": {
9892
+ "type": "string",
9893
+ "description": "The operation to be performed on a header. The 'append' operation is not supported for request headers.",
9894
+ "enum": [
9895
+ "set",
9896
+ "remove"
9897
+ ]
9898
+ },
9899
+ "value": {
9900
+ "type": "string",
9901
+ "optional": true,
9902
+ "description": "The new value for the header. Must be specified for the 'set' operation."
9903
+ }
9904
+ }
9905
+ },
9906
+ "responseHeaders": {
9907
+ "type": "object",
9908
+ "optional": true,
9909
+ "description": "The response headers to modify for the request. Only valid when type is 'modifyHeaders'.",
9910
+ "properties": {
9911
+ "header": {
9912
+ "type": "string",
9913
+ "description": "The name of the response header to be modified."
9914
+ },
9915
+ "operation": {
9916
+ "type": "string",
9917
+ "description": "The operation to be performed on a header.",
9918
+ "enum": [
9919
+ "append",
9920
+ "set",
9921
+ "remove"
9922
+ ]
9923
+ },
9924
+ "value": {
9925
+ "type": "string",
9926
+ "optional": true,
9927
+ "description": "The new value for the header. Must be specified for the 'append' and 'set' operations."
9928
+ }
9929
+ }
9930
+ }
9931
+ }
9932
+ }
9933
+ }
9702
9934
  }
9703
9935
  ],
9704
9936
  "functions": [
9937
+ {
9938
+ "name": "updateSessionRules",
9939
+ "type": "function",
9940
+ "description": "Modifies the current set of session scoped rules for the extension. The rules with IDs listed in options.removeRuleIds are first removed, and then the rules given in options.addRules are added. These rules are not persisted across sessions and are backed in memory.",
9941
+ "async": "callback",
9942
+ "parameters": [
9943
+ {
9944
+ "name": "options",
9945
+ "type": "object",
9946
+ "properties": {
9947
+ "removeRuleIds": {
9948
+ "type": "array",
9949
+ "optional": true,
9950
+ "description": "IDs of the rules to remove. Any invalid IDs will be ignored.",
9951
+ "items": {
9952
+ "type": "integer"
9953
+ }
9954
+ },
9955
+ "addRules": {
9956
+ "type": "array",
9957
+ "optional": true,
9958
+ "description": "Rules to add.",
9959
+ "items": {
9960
+ "$ref": "Rule"
9961
+ }
9962
+ }
9963
+ }
9964
+ },
9965
+ {
9966
+ "name": "callback",
9967
+ "type": "function",
9968
+ "description": "Called when the session rules have been updated",
9969
+ "parameters": []
9970
+ }
9971
+ ]
9972
+ },
9973
+ {
9974
+ "name": "getSessionRules",
9975
+ "type": "function",
9976
+ "description": "Returns the current set of session scoped rules for the extension.",
9977
+ "async": "callback",
9978
+ "parameters": [
9979
+ {
9980
+ "name": "callback",
9981
+ "type": "function",
9982
+ "parameters": [
9983
+ {
9984
+ "type": "array",
9985
+ "items": {
9986
+ "$ref": "Rule"
9987
+ }
9988
+ }
9989
+ ]
9990
+ }
9991
+ ]
9992
+ },
9705
9993
  {
9706
9994
  "name": "testMatchOutcome",
9707
9995
  "type": "function",
@@ -19420,21 +19708,34 @@
19420
19708
  "$ref": "CertificateInfo"
19421
19709
  }
19422
19710
  },
19423
- "isDomainMismatch": {
19424
- "description": "The domain name does not match the certificate domain.",
19425
- "type": "boolean",
19711
+ "overridableErrorCategory": {
19712
+ "description": "The type of certificate error that was overridden for this connection, if any.",
19713
+ "type": "string",
19714
+ "enum": [
19715
+ "trust_error",
19716
+ "domain_mismatch",
19717
+ "expired_or_not_yet_valid"
19718
+ ],
19426
19719
  "optional": true
19427
19720
  },
19428
- "isExtendedValidation": {
19721
+ "isDomainMismatch": {
19722
+ "description": "The domain name does not match the certificate domain.",
19429
19723
  "type": "boolean",
19430
- "optional": true
19724
+ "optional": true,
19725
+ "deprecated": "Please use $(ref:SecurityInfo.overridableErrorCategory)."
19431
19726
  },
19432
19727
  "isNotValidAtThisTime": {
19433
19728
  "description": "The certificate is either expired or is not yet valid. See <code>CertificateInfo.validity</code> for start and end dates.",
19434
19729
  "type": "boolean",
19435
- "optional": true
19730
+ "optional": true,
19731
+ "deprecated": "Please use $(ref:SecurityInfo.overridableErrorCategory)."
19436
19732
  },
19437
19733
  "isUntrusted": {
19734
+ "type": "boolean",
19735
+ "optional": true,
19736
+ "deprecated": "Please use $(ref:SecurityInfo.overridableErrorCategory)."
19737
+ },
19738
+ "isExtendedValidation": {
19438
19739
  "type": "boolean",
19439
19740
  "optional": true
19440
19741
  },