webext-schema 5.0.11 → 5.1.1

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,6 @@ import JSON5 from 'json5';
8
8
  import { createFile } from './file-util.js';
9
9
  import { getType, isString } from './common.js';
10
10
  import { program as commander } from 'commander';
11
- import fetch from 'node-fetch';
12
11
  import path from 'node:path';
13
12
  import process from 'node:process';
14
13
 
package/package.json CHANGED
@@ -2,15 +2,36 @@
2
2
  "name": "webext-schema",
3
3
  "description": "WebExtensions schemas fetched from hg.mozilla.org",
4
4
  "author": "asamuzaK",
5
+ "license": "MPL-2.0",
5
6
  "homepage": "https://github.com/asamuzaK/webext-schema",
6
7
  "bugs": "https://github.com/asamuzaK/webext-schema/issues",
7
8
  "repository": {
8
9
  "type": "git",
9
10
  "url": "https://github.com/asamuzaK/webext-schema.git"
10
11
  },
11
- "license": "MPL-2.0",
12
- "main": "index.js",
13
12
  "type": "module",
13
+ "main": "index.js",
14
+ "dependencies": {
15
+ "camelize": "^1.0.1",
16
+ "commander": "^10.0.0",
17
+ "decamelize": "^6.0.0",
18
+ "json5": "^2.2.3",
19
+ "sinon": "^15.0.1"
20
+ },
21
+ "devDependencies": {
22
+ "c8": "^7.12.0",
23
+ "chai": "^4.3.7",
24
+ "eslint": "^8.34.0",
25
+ "eslint-config-standard": "^17.0.0",
26
+ "eslint-plugin-import": "^2.27.5",
27
+ "eslint-plugin-jsdoc": "^40.0.0",
28
+ "eslint-plugin-node": "^11.1.0",
29
+ "eslint-plugin-promise": "^6.1.1",
30
+ "eslint-plugin-unicorn": "^45.0.2",
31
+ "mocha": "^10.2.0",
32
+ "npm-run-all": "^4.1.5",
33
+ "undici": "^5.18.0"
34
+ },
14
35
  "scripts": {
15
36
  "lint": "eslint --fix .",
16
37
  "start": "node index",
@@ -27,27 +48,5 @@
27
48
  "update-mail": "node index update --channel=mail -i",
28
49
  "update-release": "node index update --channel=release -i"
29
50
  },
30
- "dependencies": {
31
- "camelize": "^1.0.1",
32
- "commander": "^9.5.0",
33
- "decamelize": "^6.0.0",
34
- "json5": "^2.2.3",
35
- "node-fetch": "^3.3.0",
36
- "sinon": "^15.0.1"
37
- },
38
- "devDependencies": {
39
- "c8": "^7.12.0",
40
- "chai": "^4.3.7",
41
- "eslint": "^8.31.0",
42
- "eslint-config-standard": "^17.0.0",
43
- "eslint-plugin-import": "^2.26.0",
44
- "eslint-plugin-jsdoc": "^39.6.4",
45
- "eslint-plugin-node": "^11.1.0",
46
- "eslint-plugin-promise": "^6.1.1",
47
- "eslint-plugin-unicorn": "^45.0.2",
48
- "mocha": "^10.2.0",
49
- "nock": "^13.2.9",
50
- "npm-run-all": "^4.1.5"
51
- },
52
- "version": "5.0.11"
51
+ "version": "5.1.1"
53
52
  }
@@ -2507,6 +2507,7 @@
2507
2507
  },
2508
2508
  "bookmarkId": {
2509
2509
  "type": "string",
2510
+ "optional": true,
2510
2511
  "description": "The id of the bookmark where the context menu was clicked, if it was on a bookmark."
2511
2512
  },
2512
2513
  "modifiers": {
@@ -10106,6 +10107,42 @@
10106
10107
  }
10107
10108
  ],
10108
10109
  "functions": [
10110
+ {
10111
+ "name": "updateDynamicRules",
10112
+ "type": "function",
10113
+ "description": "Modifies the current set of dynamic 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 persisted across browser sessions and extension updates.",
10114
+ "async": "callback",
10115
+ "parameters": [
10116
+ {
10117
+ "name": "options",
10118
+ "type": "object",
10119
+ "properties": {
10120
+ "removeRuleIds": {
10121
+ "type": "array",
10122
+ "optional": true,
10123
+ "description": "IDs of the rules to remove. Any invalid IDs will be ignored.",
10124
+ "items": {
10125
+ "type": "integer"
10126
+ }
10127
+ },
10128
+ "addRules": {
10129
+ "type": "array",
10130
+ "optional": true,
10131
+ "description": "Rules to add.",
10132
+ "items": {
10133
+ "$ref": "Rule"
10134
+ }
10135
+ }
10136
+ }
10137
+ },
10138
+ {
10139
+ "name": "callback",
10140
+ "type": "function",
10141
+ "description": "Called when the dynamic rules have been updated",
10142
+ "parameters": []
10143
+ }
10144
+ ]
10145
+ },
10109
10146
  {
10110
10147
  "name": "updateSessionRules",
10111
10148
  "type": "function",
@@ -10216,6 +10253,27 @@
10216
10253
  }
10217
10254
  ]
10218
10255
  },
10256
+ {
10257
+ "name": "getDynamicRules",
10258
+ "type": "function",
10259
+ "description": "Returns the current set of dynamic rules for the extension.",
10260
+ "async": "callback",
10261
+ "parameters": [
10262
+ {
10263
+ "name": "callback",
10264
+ "type": "function",
10265
+ "parameters": [
10266
+ {
10267
+ "name": "dynamicRules",
10268
+ "type": "array",
10269
+ "items": {
10270
+ "$ref": "Rule"
10271
+ }
10272
+ }
10273
+ ]
10274
+ }
10275
+ ]
10276
+ },
10219
10277
  {
10220
10278
  "name": "getSessionRules",
10221
10279
  "type": "function",
@@ -10227,6 +10285,7 @@
10227
10285
  "type": "function",
10228
10286
  "parameters": [
10229
10287
  {
10288
+ "name": "sessionRules",
10230
10289
  "type": "array",
10231
10290
  "items": {
10232
10291
  "$ref": "Rule"
@@ -13596,7 +13655,6 @@
13596
13655
  "extension_ids": {
13597
13656
  "optional": true,
13598
13657
  "type": "array",
13599
- "minItems": 1,
13600
13658
  "items": {
13601
13659
  "choices": [
13602
13660
  {
@@ -17457,7 +17515,7 @@
17457
17515
  {
17458
17516
  "name": "submitPing",
17459
17517
  "type": "function",
17460
- "description": "Submits a custom ping to the Telemetry back-end. See <code>submitExternalPing</code> inside TelemetryController.jsm for more details.",
17518
+ "description": "Submits a custom ping to the Telemetry back-end. See <code>submitExternalPing</code> inside TelemetryController.sys.mjs for more details.",
17461
17519
  "async": true,
17462
17520
  "parameters": [
17463
17521
  {
@@ -19614,6 +19672,7 @@
19614
19672
  "enum": [
19615
19673
  "webRequest",
19616
19674
  "webRequestBlocking",
19675
+ "webRequestFilterResponse",
19617
19676
  "webRequestFilterResponse.serviceWorkerScript"
19618
19677
  ]
19619
19678
  }
@@ -1898,6 +1898,11 @@
1898
1898
  "description": "Find only ranges with case sensitive match.",
1899
1899
  "optional": true
1900
1900
  },
1901
+ "matchDiacritics": {
1902
+ "type": "boolean",
1903
+ "description": "Find only ranges with diacritic sensitive match.",
1904
+ "optional": true
1905
+ },
1901
1906
  "entireWord": {
1902
1907
  "type": "boolean",
1903
1908
  "description": "Find only ranges that match entire word.",
@@ -3577,6 +3582,16 @@
3577
3582
  "format": "url"
3578
3583
  }
3579
3584
  }
3585
+ },
3586
+ {
3587
+ "id": "Disposition",
3588
+ "type": "string",
3589
+ "description": "Location where search results should be displayed.",
3590
+ "enum": [
3591
+ "CURRENT_TAB",
3592
+ "NEW_TAB",
3593
+ "NEW_WINDOW"
3594
+ ]
3580
3595
  }
3581
3596
  ],
3582
3597
  "functions": [
@@ -3606,14 +3621,53 @@
3606
3621
  "optional": true,
3607
3622
  "description": "Search engine to use. Uses the default if not specified."
3608
3623
  },
3624
+ "disposition": {
3625
+ "$ref": "Disposition",
3626
+ "optional": true,
3627
+ "description": "Location where search results should be displayed. NEW_TAB is the default."
3628
+ },
3609
3629
  "tabId": {
3610
3630
  "type": "integer",
3611
3631
  "optional": true,
3612
- "description": "The ID of the tab for the search results. If not specified, a new tab is created."
3632
+ "description": "The ID of the tab for the search results. If not specified, a new tab is created, unless disposition is set. tabId cannot be used with disposition."
3613
3633
  }
3614
3634
  }
3615
3635
  }
3616
3636
  ]
3637
+ },
3638
+ {
3639
+ "name": "query",
3640
+ "type": "function",
3641
+ "async": "callback",
3642
+ "description": "Use the chrome.search API to search via the default provider.",
3643
+ "parameters": [
3644
+ {
3645
+ "type": "object",
3646
+ "name": "queryInfo",
3647
+ "properties": {
3648
+ "text": {
3649
+ "type": "string",
3650
+ "description": "String to query with the default search provider."
3651
+ },
3652
+ "disposition": {
3653
+ "$ref": "Disposition",
3654
+ "optional": true,
3655
+ "description": "Location where search results should be displayed. CURRENT_TAB is the default."
3656
+ },
3657
+ "tabId": {
3658
+ "type": "integer",
3659
+ "optional": true,
3660
+ "description": "Location where search results should be displayed. tabId cannot be used with disposition."
3661
+ }
3662
+ }
3663
+ },
3664
+ {
3665
+ "type": "function",
3666
+ "name": "callback",
3667
+ "optional": true,
3668
+ "parameters": []
3669
+ }
3670
+ ]
3617
3671
  }
3618
3672
  ]
3619
3673
  }
@@ -9898,7 +9952,7 @@
9898
9952
  "isUrlFilterCaseSensitive": {
9899
9953
  "type": "boolean",
9900
9954
  "optional": true,
9901
- "description": "Whether 'urlFilter' or 'regexFilter' is case-sensitive. Defaults to true."
9955
+ "description": "Whether 'urlFilter' or 'regexFilter' is case-sensitive."
9902
9956
  },
9903
9957
  "initiatorDomains": {
9904
9958
  "type": "array",
@@ -10370,7 +10424,25 @@
10370
10424
  }
10371
10425
  ]
10372
10426
  }
10373
- ]
10427
+ ],
10428
+ "properties": {
10429
+ "GUARANTEED_MINIMUM_STATIC_RULES": {
10430
+ "type": "number",
10431
+ "description": "The minimum number of static rules guaranteed to an extension across its enabled static rulesets. Any rules above this limit will count towards the global static rule limit."
10432
+ },
10433
+ "MAX_NUMBER_OF_STATIC_RULESETS": {
10434
+ "type": "number",
10435
+ "description": "The maximum number of static Rulesets an extension can specify as part of the rule_resources manifest key."
10436
+ },
10437
+ "MAX_NUMBER_OF_ENABLED_STATIC_RULESETS": {
10438
+ "type": "number",
10439
+ "description": "The maximum number of static Rulesets an extension can enable at any one time."
10440
+ },
10441
+ "MAX_NUMBER_OF_DYNAMIC_AND_SESSION_RULES": {
10442
+ "type": "number",
10443
+ "description": "The maximum number of dynamic and session rules an extension can add. NOTE: in the Firefox we are enforcing this limit to the session and dynamic rules count separately, instead of enforcing it to the rules count for both combined as the Chrome implementation does."
10444
+ }
10445
+ }
10374
10446
  }
10375
10447
  ],
10376
10448
  "dns.json": [
@@ -12339,7 +12411,6 @@
12339
12411
  "stackwalk",
12340
12412
  "jsallocations",
12341
12413
  "nostacksampling",
12342
- "preferencereads",
12343
12414
  "nativeallocations",
12344
12415
  "ipcmessages",
12345
12416
  "audiocallbacktracing",
@@ -13655,7 +13726,6 @@
13655
13726
  "extension_ids": {
13656
13727
  "optional": true,
13657
13728
  "type": "array",
13658
- "minItems": 1,
13659
13729
  "items": {
13660
13730
  "choices": [
13661
13731
  {
@@ -13691,12 +13761,6 @@
13691
13761
  "description": "Represents a WebExtension language pack manifest.json file",
13692
13762
  "$import": "ManifestBase",
13693
13763
  "properties": {
13694
- "homepage_url": {
13695
- "type": "string",
13696
- "format": "url",
13697
- "optional": true,
13698
- "preprocess": "localize"
13699
- },
13700
13764
  "langpack_id": {
13701
13765
  "type": "string",
13702
13766
  "pattern": "^[a-zA-Z][a-zA-Z-]+$"
@@ -13764,12 +13828,6 @@
13764
13828
  "description": "Represents a WebExtension dictionary manifest.json file",
13765
13829
  "$import": "ManifestBase",
13766
13830
  "properties": {
13767
- "homepage_url": {
13768
- "type": "string",
13769
- "format": "url",
13770
- "optional": true,
13771
- "preprocess": "localize"
13772
- },
13773
13831
  "dictionaries": {
13774
13832
  "type": "object",
13775
13833
  "patternProperties": {
@@ -19673,6 +19731,7 @@
19673
19731
  "enum": [
19674
19732
  "webRequest",
19675
19733
  "webRequestBlocking",
19734
+ "webRequestFilterResponse",
19676
19735
  "webRequestFilterResponse.serviceWorkerScript"
19677
19736
  ]
19678
19737
  }
@@ -8564,24 +8564,25 @@
8564
8564
  "type": "string",
8565
8565
  "enum": [
8566
8566
  "all",
8567
- "page",
8568
- "frame",
8569
- "selection",
8570
- "link",
8571
- "editable",
8572
- "password",
8573
- "image",
8574
- "video",
8567
+ "all_message_attachments",
8575
8568
  "audio",
8576
8569
  "compose_action",
8577
- "message_display_action",
8578
- "tab",
8579
- "message_list",
8580
- "folder_pane",
8581
8570
  "compose_attachments",
8571
+ "compose_body",
8572
+ "editable",
8573
+ "folder_pane",
8574
+ "frame",
8575
+ "image",
8576
+ "link",
8582
8577
  "message_attachments",
8583
- "all_message_attachments",
8584
- "tools_menu"
8578
+ "message_display_action",
8579
+ "message_list",
8580
+ "page",
8581
+ "password",
8582
+ "selection",
8583
+ "tab",
8584
+ "tools_menu",
8585
+ "video"
8585
8586
  ]
8586
8587
  },
8587
8588
  {
@@ -11536,7 +11537,7 @@
11536
11537
  {
11537
11538
  "name": "create",
11538
11539
  "type": "function",
11539
- "description": "Creates a new content tab. Use the :ref:`messageDisplay_api` to open messages. Only supported in <value>normal</value> windows.",
11540
+ "description": "Creates a new content tab. Use the :ref:`messageDisplay_api` to open messages. Only supported in <value>normal</value> windows. Same-site links in the loaded page are opened within Thunderbird, all other links are opened in the user's default browser. To override this behavior, add-ons have to register a `content script <https://bugzilla.mozilla.org/show_bug.cgi?id=1618828#c3>`__ , capture click events and handle them manually.",
11540
11541
  "async": "callback",
11541
11542
  "parameters": [
11542
11543
  {
@@ -12420,7 +12421,7 @@
12420
12421
  {
12421
12422
  "name": "create",
12422
12423
  "type": "function",
12423
- "description": "Creates (opens) a new window with any optional sizing, position or default URL provided.",
12424
+ "description": "Creates (opens) a new window with any optional sizing, position or default URL provided. When loading a page into a popup window, same-site links are opened within the same window, all other links are opened in the user's default browser. To override this behavior, add-ons have to register a `content script <https://bugzilla.mozilla.org/show_bug.cgi?id=1618828#c3>`__ , capture click events and handle them manually. Same-site links with targets other than <value>_self</value> are opened in a new tab in the most recent ``normal`` Thunderbird window.",
12424
12425
  "async": "callback",
12425
12426
  "parameters": [
12426
12427
  {
@@ -2507,6 +2507,7 @@
2507
2507
  },
2508
2508
  "bookmarkId": {
2509
2509
  "type": "string",
2510
+ "optional": true,
2510
2511
  "description": "The id of the bookmark where the context menu was clicked, if it was on a bookmark."
2511
2512
  },
2512
2513
  "modifiers": {
@@ -10106,6 +10107,42 @@
10106
10107
  }
10107
10108
  ],
10108
10109
  "functions": [
10110
+ {
10111
+ "name": "updateDynamicRules",
10112
+ "type": "function",
10113
+ "description": "Modifies the current set of dynamic 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 persisted across browser sessions and extension updates.",
10114
+ "async": "callback",
10115
+ "parameters": [
10116
+ {
10117
+ "name": "options",
10118
+ "type": "object",
10119
+ "properties": {
10120
+ "removeRuleIds": {
10121
+ "type": "array",
10122
+ "optional": true,
10123
+ "description": "IDs of the rules to remove. Any invalid IDs will be ignored.",
10124
+ "items": {
10125
+ "type": "integer"
10126
+ }
10127
+ },
10128
+ "addRules": {
10129
+ "type": "array",
10130
+ "optional": true,
10131
+ "description": "Rules to add.",
10132
+ "items": {
10133
+ "$ref": "Rule"
10134
+ }
10135
+ }
10136
+ }
10137
+ },
10138
+ {
10139
+ "name": "callback",
10140
+ "type": "function",
10141
+ "description": "Called when the dynamic rules have been updated",
10142
+ "parameters": []
10143
+ }
10144
+ ]
10145
+ },
10109
10146
  {
10110
10147
  "name": "updateSessionRules",
10111
10148
  "type": "function",
@@ -10216,6 +10253,27 @@
10216
10253
  }
10217
10254
  ]
10218
10255
  },
10256
+ {
10257
+ "name": "getDynamicRules",
10258
+ "type": "function",
10259
+ "description": "Returns the current set of dynamic rules for the extension.",
10260
+ "async": "callback",
10261
+ "parameters": [
10262
+ {
10263
+ "name": "callback",
10264
+ "type": "function",
10265
+ "parameters": [
10266
+ {
10267
+ "name": "dynamicRules",
10268
+ "type": "array",
10269
+ "items": {
10270
+ "$ref": "Rule"
10271
+ }
10272
+ }
10273
+ ]
10274
+ }
10275
+ ]
10276
+ },
10219
10277
  {
10220
10278
  "name": "getSessionRules",
10221
10279
  "type": "function",
@@ -10227,6 +10285,7 @@
10227
10285
  "type": "function",
10228
10286
  "parameters": [
10229
10287
  {
10288
+ "name": "sessionRules",
10230
10289
  "type": "array",
10231
10290
  "items": {
10232
10291
  "$ref": "Rule"
@@ -13596,7 +13655,6 @@
13596
13655
  "extension_ids": {
13597
13656
  "optional": true,
13598
13657
  "type": "array",
13599
- "minItems": 1,
13600
13658
  "items": {
13601
13659
  "choices": [
13602
13660
  {
@@ -17457,7 +17515,7 @@
17457
17515
  {
17458
17516
  "name": "submitPing",
17459
17517
  "type": "function",
17460
- "description": "Submits a custom ping to the Telemetry back-end. See <code>submitExternalPing</code> inside TelemetryController.jsm for more details.",
17518
+ "description": "Submits a custom ping to the Telemetry back-end. See <code>submitExternalPing</code> inside TelemetryController.sys.mjs for more details.",
17461
17519
  "async": true,
17462
17520
  "parameters": [
17463
17521
  {
@@ -19614,6 +19672,7 @@
19614
19672
  "enum": [
19615
19673
  "webRequest",
19616
19674
  "webRequestBlocking",
19675
+ "webRequestFilterResponse",
19617
19676
  "webRequestFilterResponse.serviceWorkerScript"
19618
19677
  ]
19619
19678
  }