webext-schema 5.1.0 → 5.1.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/README.md CHANGED
@@ -1,14 +1,10 @@
1
1
  [![build](https://github.com/asamuzaK/webext-schema/workflows/build/badge.svg)](https://github.com/asamuzaK/webext-schema/actions?query=workflow%3Abuild)
2
2
  [![CodeQL](https://github.com/asamuzaK/webext-schema/workflows/CodeQL/badge.svg)](https://github.com/asamuzaK/webext-schema/actions?query=workflow%3ACodeQL)
3
- <!--
4
- [![dependencies Status](https://david-dm.org/asamuzaK/webext-schema/status.svg)](https://david-dm.org/asamuzaK/webext-schema)
5
- [![devDependencies Status](https://david-dm.org/asamuzaK/webext-schema/dev-status.svg)](https://david-dm.org/asamuzaK/webext-schema?type=dev)
6
- -->
7
- [![npm version](https://badge.fury.io/js/webext-schema.svg)](https://badge.fury.io/js/webext-schema)
3
+ [![npm](https://img.shields.io/npm/v/webext-schema)](https://www.npmjs.com/package/webext-schema)
8
4
 
9
5
  # webext-schema
10
6
 
11
- WebExtensions schemas and MailExtensions schemas fetched from [hg.mozilla.org](https://hg.mozilla.org/).
7
+ [WebExtentions](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions "Browser Extensions - Mozilla | MDN") schemas and [MailExtensions](https://developer.thunderbird.net/add-ons/mailextensions "A Guide to Extensions - Thunderbird") schemas fetched from [hg.mozilla.org](https://hg.mozilla.org/).
12
8
  Stubbed browser API is also available.
13
9
 
14
10
  ## Install
package/index.js CHANGED
@@ -1,5 +1,9 @@
1
- /**
2
- * index.js
1
+ /*!
2
+ * webext-schema
3
+ *
4
+ * @license MPL-2.0
5
+ * @copyright asamuzaK (Kazz)
6
+ * @see {@link https://github.com/asamuzaK/webext-schema/blob/master/LICENSE}
3
7
  */
4
8
 
5
9
  /* api */
package/package.json CHANGED
@@ -2,31 +2,15 @@
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",
14
- "scripts": {
15
- "lint": "eslint --fix .",
16
- "start": "node index",
17
- "test": "npm run test-central",
18
- "test-beta": "c8 mocha --require=test/mocha/setup.js --channel=beta --exit test/*.test.js",
19
- "test-central": "c8 mocha --require=test/mocha/setup.js --channel=central --exit test/*.test.js",
20
- "test-esr": "c8 mocha --require=test/mocha/setup.js --channel=esr --exit test/*.test.js",
21
- "test-release": "c8 mocha --require=test/mocha/setup.js --channel=release --exit test/*.test.js",
22
- "test_all": "npm-run-all -s test-*",
23
- "update": "node index update -i",
24
- "update-beta": "node index update --channel=beta -i",
25
- "update-central": "node index update --channel=central -i",
26
- "update-esr": "node index update --channel=esr -i",
27
- "update-mail": "node index update --channel=mail -i",
28
- "update-release": "node index update --channel=release -i"
29
- },
13
+ "main": "index.js",
30
14
  "dependencies": {
31
15
  "camelize": "^1.0.1",
32
16
  "commander": "^10.0.0",
@@ -37,16 +21,32 @@
37
21
  "devDependencies": {
38
22
  "c8": "^7.12.0",
39
23
  "chai": "^4.3.7",
40
- "eslint": "^8.32.0",
24
+ "eslint": "^8.34.0",
41
25
  "eslint-config-standard": "^17.0.0",
42
- "eslint-plugin-import": "^2.27.4",
43
- "eslint-plugin-jsdoc": "^39.6.4",
26
+ "eslint-plugin-import": "^2.27.5",
27
+ "eslint-plugin-jsdoc": "^40.0.0",
44
28
  "eslint-plugin-node": "^11.1.0",
45
29
  "eslint-plugin-promise": "^6.1.1",
46
30
  "eslint-plugin-unicorn": "^45.0.2",
47
31
  "mocha": "^10.2.0",
48
32
  "npm-run-all": "^4.1.5",
49
- "undici": "^5.15.0"
33
+ "undici": "^5.19.1"
34
+ },
35
+ "scripts": {
36
+ "lint": "eslint --fix .",
37
+ "start": "node index",
38
+ "test": "npm run test-central",
39
+ "test-beta": "c8 mocha --require=test/mocha/setup.js --channel=beta --exit test/*.test.js",
40
+ "test-central": "c8 mocha --require=test/mocha/setup.js --channel=central --exit test/*.test.js",
41
+ "test-esr": "c8 mocha --require=test/mocha/setup.js --channel=esr --exit test/*.test.js",
42
+ "test-release": "c8 mocha --require=test/mocha/setup.js --channel=release --exit test/*.test.js",
43
+ "test_all": "npm-run-all -s test-*",
44
+ "update": "node index update -i",
45
+ "update-beta": "node index update --channel=beta -i",
46
+ "update-central": "node index update --channel=central -i",
47
+ "update-esr": "node index update --channel=esr -i",
48
+ "update-mail": "node index update --channel=mail -i",
49
+ "update-release": "node index update --channel=release -i"
50
50
  },
51
- "version": "5.1.0"
51
+ "version": "5.1.2"
52
52
  }
@@ -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,12 +3621,51 @@
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
+ },
3629
+ "tabId": {
3630
+ "type": "integer",
3631
+ "optional": true,
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."
3633
+ }
3634
+ }
3635
+ }
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
+ },
3609
3657
  "tabId": {
3610
3658
  "type": "integer",
3611
3659
  "optional": true,
3612
- "description": "The ID of the tab for the search results. If not specified, a new tab is created."
3660
+ "description": "Location where search results should be displayed. tabId cannot be used with disposition."
3613
3661
  }
3614
3662
  }
3663
+ },
3664
+ {
3665
+ "type": "function",
3666
+ "name": "callback",
3667
+ "optional": true,
3668
+ "parameters": []
3615
3669
  }
3616
3670
  ]
3617
3671
  }
@@ -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,35 @@
10370
10424
  }
10371
10425
  ]
10372
10426
  }
10373
- ]
10427
+ ],
10428
+ "properties": {
10429
+ "DYNAMIC_RULESET_ID": {
10430
+ "type": "string",
10431
+ "value": "_dynamic",
10432
+ "description": "Ruleset ID for the dynamic rules added by the extension."
10433
+ },
10434
+ "GUARANTEED_MINIMUM_STATIC_RULES": {
10435
+ "type": "number",
10436
+ "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."
10437
+ },
10438
+ "MAX_NUMBER_OF_STATIC_RULESETS": {
10439
+ "type": "number",
10440
+ "description": "The maximum number of static Rulesets an extension can specify as part of the rule_resources manifest key."
10441
+ },
10442
+ "MAX_NUMBER_OF_ENABLED_STATIC_RULESETS": {
10443
+ "type": "number",
10444
+ "description": "The maximum number of static Rulesets an extension can enable at any one time."
10445
+ },
10446
+ "MAX_NUMBER_OF_DYNAMIC_AND_SESSION_RULES": {
10447
+ "type": "number",
10448
+ "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."
10449
+ },
10450
+ "SESSION_RULESET_ID": {
10451
+ "type": "string",
10452
+ "value": "_session",
10453
+ "description": "Ruleset ID for the session-scoped rules added by the extension."
10454
+ }
10455
+ }
10374
10456
  }
10375
10457
  ],
10376
10458
  "dns.json": [
@@ -12339,7 +12421,6 @@
12339
12421
  "stackwalk",
12340
12422
  "jsallocations",
12341
12423
  "nostacksampling",
12342
- "preferencereads",
12343
12424
  "nativeallocations",
12344
12425
  "ipcmessages",
12345
12426
  "audiocallbacktracing",
@@ -13690,12 +13771,6 @@
13690
13771
  "description": "Represents a WebExtension language pack manifest.json file",
13691
13772
  "$import": "ManifestBase",
13692
13773
  "properties": {
13693
- "homepage_url": {
13694
- "type": "string",
13695
- "format": "url",
13696
- "optional": true,
13697
- "preprocess": "localize"
13698
- },
13699
13774
  "langpack_id": {
13700
13775
  "type": "string",
13701
13776
  "pattern": "^[a-zA-Z][a-zA-Z-]+$"
@@ -13763,12 +13838,6 @@
13763
13838
  "description": "Represents a WebExtension dictionary manifest.json file",
13764
13839
  "$import": "ManifestBase",
13765
13840
  "properties": {
13766
- "homepage_url": {
13767
- "type": "string",
13768
- "format": "url",
13769
- "optional": true,
13770
- "preprocess": "localize"
13771
- },
13772
13841
  "dictionaries": {
13773
13842
  "type": "object",
13774
13843
  "patternProperties": {
@@ -3582,6 +3582,16 @@
3582
3582
  "format": "url"
3583
3583
  }
3584
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
+ ]
3585
3595
  }
3586
3596
  ],
3587
3597
  "functions": [
@@ -3611,14 +3621,53 @@
3611
3621
  "optional": true,
3612
3622
  "description": "Search engine to use. Uses the default if not specified."
3613
3623
  },
3624
+ "disposition": {
3625
+ "$ref": "Disposition",
3626
+ "optional": true,
3627
+ "description": "Location where search results should be displayed. NEW_TAB is the default."
3628
+ },
3614
3629
  "tabId": {
3615
3630
  "type": "integer",
3616
3631
  "optional": true,
3617
- "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."
3618
3633
  }
3619
3634
  }
3620
3635
  }
3621
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
+ ]
3622
3671
  }
3623
3672
  ]
3624
3673
  }
@@ -9903,7 +9952,7 @@
9903
9952
  "isUrlFilterCaseSensitive": {
9904
9953
  "type": "boolean",
9905
9954
  "optional": true,
9906
- "description": "Whether 'urlFilter' or 'regexFilter' is case-sensitive. Defaults to true."
9955
+ "description": "Whether 'urlFilter' or 'regexFilter' is case-sensitive."
9907
9956
  },
9908
9957
  "initiatorDomains": {
9909
9958
  "type": "array",
@@ -10375,7 +10424,25 @@
10375
10424
  }
10376
10425
  ]
10377
10426
  }
10378
- ]
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
+ }
10379
10446
  }
10380
10447
  ],
10381
10448
  "dns.json": [
@@ -12344,7 +12411,6 @@
12344
12411
  "stackwalk",
12345
12412
  "jsallocations",
12346
12413
  "nostacksampling",
12347
- "preferencereads",
12348
12414
  "nativeallocations",
12349
12415
  "ipcmessages",
12350
12416
  "audiocallbacktracing",
@@ -13695,12 +13761,6 @@
13695
13761
  "description": "Represents a WebExtension language pack manifest.json file",
13696
13762
  "$import": "ManifestBase",
13697
13763
  "properties": {
13698
- "homepage_url": {
13699
- "type": "string",
13700
- "format": "url",
13701
- "optional": true,
13702
- "preprocess": "localize"
13703
- },
13704
13764
  "langpack_id": {
13705
13765
  "type": "string",
13706
13766
  "pattern": "^[a-zA-Z][a-zA-Z-]+$"
@@ -13768,12 +13828,6 @@
13768
13828
  "description": "Represents a WebExtension dictionary manifest.json file",
13769
13829
  "$import": "ManifestBase",
13770
13830
  "properties": {
13771
- "homepage_url": {
13772
- "type": "string",
13773
- "format": "url",
13774
- "optional": true,
13775
- "preprocess": "localize"
13776
- },
13777
13831
  "dictionaries": {
13778
13832
  "type": "object",
13779
13833
  "patternProperties": {
@@ -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
  }