webext-schema 4.1.3 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -35,14 +35,14 @@ export const createBookmark = async opt => {
35
35
  const { bookmarks } = browser;
36
36
  node = await bookmarks.create(opt);
37
37
  }
38
- return node || null;
38
+ return node ?? null;
39
39
  };
40
40
 
41
41
  /**
42
42
  * get bookmark tree node
43
43
  *
44
44
  * @param {string|Array} id - bookmark ID or array of bookmark IDs
45
- * @returns {Array} - array of bookmarks.BookmarkTreeNode
45
+ * @returns {?Array} - array of bookmarks.BookmarkTreeNode
46
46
  */
47
47
  export const getBookmarkTreeNode = async id => {
48
48
  const isGranted = await isPermissionGranted({
@@ -59,7 +59,7 @@ export const getBookmarkTreeNode = async id => {
59
59
  res = await bookmarks.getTree();
60
60
  }
61
61
  }
62
- return res || null;
62
+ return res ?? null;
63
63
  };
64
64
 
65
65
  /* browserSettings */
@@ -77,7 +77,7 @@ export const getCloseTabsByDoubleClickValue = async () => {
77
77
  const { browserSettings: { closeTabsByDoubleClick } } = browser;
78
78
  userValue = await closeTabsByDoubleClick.get({});
79
79
  }
80
- return userValue || null;
80
+ return userValue ?? null;
81
81
  };
82
82
 
83
83
  /**
@@ -135,7 +135,7 @@ export const getNewTabPositionValue = async () => {
135
135
  const { browserSettings: { newTabPosition } } = browser;
136
136
  res = await newTabPosition.get({});
137
137
  }
138
- return res || null;
138
+ return res ?? null;
139
139
  };
140
140
 
141
141
  /* commands */
@@ -185,7 +185,7 @@ export const updateCommand = async (id, value = '') => {
185
185
  });
186
186
  }
187
187
  }
188
- return func || null;
188
+ return func ?? null;
189
189
  };
190
190
 
191
191
  /* contextualIdentities */
@@ -201,13 +201,9 @@ export const getAllContextualIdentities = async () => {
201
201
  let arr;
202
202
  if (isGranted) {
203
203
  const { contextualIdentities } = browser;
204
- try {
205
- arr = await contextualIdentities.query({});
206
- } catch (e) {
207
- logErr(e);
208
- }
204
+ arr = await contextualIdentities.query({});
209
205
  }
210
- return arr || null;
206
+ return arr ?? null;
211
207
  };
212
208
 
213
209
  /**
@@ -226,13 +222,9 @@ export const getContextualId = async cookieStoreId => {
226
222
  let id;
227
223
  if (isGranted) {
228
224
  const { contextualIdentities } = browser;
229
- try {
230
- id = await contextualIdentities.get(cookieStoreId);
231
- } catch (e) {
232
- logErr(e);
233
- }
225
+ id = await contextualIdentities.get(cookieStoreId);
234
226
  }
235
- return id || null;
227
+ return id ?? null;
236
228
  };
237
229
 
238
230
  /* management */
@@ -248,17 +240,12 @@ export const getEnabledTheme = async () => {
248
240
  let res;
249
241
  if (isGranted) {
250
242
  const { management } = browser;
251
- try {
252
- const arr = await management.getAll();
253
- if (Array.isArray(arr) && arr.length) {
254
- res =
255
- arr.filter(info => info?.type === 'theme' && info?.enabled && info);
256
- }
257
- } catch (e) {
258
- logErr(e);
243
+ const arr = await management.getAll();
244
+ if (Array.isArray(arr) && arr.length) {
245
+ res = arr.filter(info => info?.type === 'theme' && info?.enabled && info);
259
246
  }
260
247
  }
261
- return res || null;
248
+ return res ?? null;
262
249
  };
263
250
 
264
251
  /**
@@ -279,13 +266,13 @@ export const getExtensionInfo = async id => {
279
266
  const { management } = browser;
280
267
  ext = await management.get(id);
281
268
  }
282
- return ext || null;
269
+ return ext ?? null;
283
270
  };
284
271
 
285
272
  /**
286
273
  * get external extensions
287
274
  *
288
- * @returns {?Array} -array of management.extensionInfo
275
+ * @returns {?Array|boolean} -array of management.extensionInfo
289
276
  */
290
277
  export const getExternalExtensions = async () => {
291
278
  const isGranted = await isPermissionGranted({
@@ -294,17 +281,12 @@ export const getExternalExtensions = async () => {
294
281
  let res;
295
282
  if (isGranted) {
296
283
  const { management } = browser;
297
- try {
298
- const arr = await management.getAll();
299
- if (Array.isArray(arr) && arr.length) {
300
- res =
301
- arr.filter(info => info?.type === 'extension' && info);
302
- }
303
- } catch (e) {
304
- logErr(e);
284
+ const arr = await management.getAll();
285
+ if (Array.isArray(arr) && arr.length) {
286
+ res = arr.filter(info => info?.type === 'extension' && info);
305
287
  }
306
288
  }
307
- return res || null;
289
+ return res ?? null;
308
290
  };
309
291
 
310
292
  /* notifications */
@@ -326,7 +308,7 @@ export const clearNotification = async id => {
326
308
  const { notifications } = browser;
327
309
  func = notifications.clear(id);
328
310
  }
329
- return func || null;
311
+ return func ?? null;
330
312
  };
331
313
 
332
314
  /**
@@ -351,7 +333,7 @@ export const createNotification = async (id, opt) => {
351
333
  }
352
334
  func = notifications.create(id, opt);
353
335
  }
354
- return func || null;
336
+ return func ?? null;
355
337
  };
356
338
 
357
339
  /* permissions */
@@ -487,7 +469,55 @@ export const sendMessage = async (id, msg, opt) => {
487
469
  func = runtime.sendMessage(msg, opt);
488
470
  }
489
471
  }
490
- return func || null;
472
+ return func ?? null;
473
+ };
474
+
475
+ /* scripting */
476
+ /**
477
+ * is scripting available
478
+ *
479
+ * @returns {boolean} - result
480
+ */
481
+ export const isScriptingAvailable = async () => {
482
+ const isGranted = await isPermissionGranted({
483
+ permissions: ['scripting']
484
+ });
485
+ let res;
486
+ if (isGranted) {
487
+ const { scripting } = browser;
488
+ res = typeof scripting?.executeScript === 'function';
489
+ }
490
+ return !!res;
491
+ };
492
+
493
+ /**
494
+ * execute script to tab
495
+ *
496
+ * @param {object} opt - options
497
+ * @returns {?Array|boolean} - array of InjectionResult object
498
+ */
499
+ export const executeScriptToTab = async (opt = {}) => {
500
+ const { args, injectImmediately, files, func, target } = opt;
501
+ const isGranted = await isScriptingAvailable();
502
+ let fn;
503
+ if (isGranted && Number.isInteger(target?.tabId)) {
504
+ const { scripting } = browser;
505
+ if (Array.isArray(files) && files.length) {
506
+ fn = scripting.executeScript({
507
+ files,
508
+ target,
509
+ injectImmediately: !!injectImmediately
510
+ });
511
+ } else if (typeof func === 'function') {
512
+ fn = scripting.executeScript({
513
+ func,
514
+ target,
515
+ args: Array.isArray(args) ? args : null,
516
+ injectImmediately: !!injectImmediately
517
+ });
518
+ }
519
+ }
520
+ return fn ?? null;
491
521
  };
492
522
 
493
523
  /* search */
@@ -543,7 +573,7 @@ export const getRecentlyClosedTab = async windowId => {
543
573
  }
544
574
  }
545
575
  }
546
- return tab || null;
576
+ return tab ?? null;
547
577
  };
548
578
 
549
579
  /**
@@ -568,7 +598,7 @@ export const getSessionWindowValue = async (key, windowId) => {
568
598
  const { sessions } = browser;
569
599
  value = await sessions.getWindowValue(windowId, key);
570
600
  }
571
- return value || null;
601
+ return value ?? null;
572
602
  };
573
603
 
574
604
  /**
@@ -589,7 +619,7 @@ export const restoreSession = async sessionId => {
589
619
  const { sessions } = browser;
590
620
  ses = await sessions.restore(sessionId);
591
621
  }
592
- return ses || null;
622
+ return ses ?? null;
593
623
  };
594
624
 
595
625
  /**
@@ -620,66 +650,74 @@ export const setSessionWindowValue = async (key, value, windowId) => {
620
650
  /**
621
651
  * clear storage
622
652
  *
653
+ * @param {string} area - storage area
623
654
  * @returns {void}
624
655
  */
625
- export const clearStorage = async () => {
656
+ export const clearStorage = async (area = 'local') => {
626
657
  const isGranted = await isPermissionGranted({
627
658
  permissions: ['storage']
628
659
  });
629
- if (isGranted) {
660
+ const areas = ['local', 'session', 'sync'];
661
+ if (isGranted && areas.includes(area)) {
630
662
  const { storage } = browser;
631
- await storage.local.clear();
663
+ await storage[area]?.clear();
632
664
  }
633
665
  };
634
666
 
635
667
  /**
636
668
  * get all storage
637
669
  *
670
+ * @param {string} area - storage area
638
671
  * @returns {object} - stored data
639
672
  */
640
- export const getAllStorage = async () => {
673
+ export const getAllStorage = async (area = 'local') => {
641
674
  const isGranted = await isPermissionGranted({
642
675
  permissions: ['storage']
643
676
  });
677
+ const areas = ['local', 'managed', 'session', 'sync'];
644
678
  let data;
645
- if (isGranted) {
679
+ if (isGranted && areas.includes(area)) {
646
680
  const { storage } = browser;
647
- data = await storage.local.get();
681
+ data = await storage[area]?.get();
648
682
  }
649
- return data || null;
683
+ return data ?? null;
650
684
  };
651
685
 
652
686
  /**
653
687
  * get storage
654
688
  *
655
689
  * @param {*} key - key
690
+ * @param {string} area - storage area
656
691
  * @returns {object} - stored data
657
692
  */
658
- export const getStorage = async key => {
693
+ export const getStorage = async (key, area = 'local') => {
659
694
  const isGranted = await isPermissionGranted({
660
695
  permissions: ['storage']
661
696
  });
697
+ const areas = ['local', 'managed', 'session', 'sync'];
662
698
  let data;
663
- if (isGranted) {
699
+ if (isGranted && areas.includes(area)) {
664
700
  const { storage } = browser;
665
- data = await storage.local.get(key);
701
+ data = await storage[area]?.get(key);
666
702
  }
667
- return data || null;
703
+ return data ?? null;
668
704
  };
669
705
 
670
706
  /**
671
707
  * remove storage
672
708
  *
673
709
  * @param {*} key - key
710
+ * @param {string} area - storage area
674
711
  * @returns {void}
675
712
  */
676
- export const removeStorage = async key => {
713
+ export const removeStorage = async (key, area = 'local') => {
677
714
  const isGranted = await isPermissionGranted({
678
715
  permissions: ['storage']
679
716
  });
680
- if (isGranted) {
717
+ const areas = ['local', 'session', 'sync'];
718
+ if (isGranted && areas.includes(area)) {
681
719
  const { storage } = browser;
682
- await storage.local.remove(key);
720
+ await storage[area]?.remove(key);
683
721
  }
684
722
  };
685
723
 
@@ -687,15 +725,17 @@ export const removeStorage = async key => {
687
725
  * set storage
688
726
  *
689
727
  * @param {object} obj - object to store
728
+ * @param {string} area - storage area
690
729
  * @returns {void}
691
730
  */
692
- export const setStorage = async obj => {
731
+ export const setStorage = async (obj, area = 'local') => {
693
732
  const isGranted = await isPermissionGranted({
694
733
  permissions: ['storage']
695
734
  });
696
- if (isGranted && obj) {
735
+ const areas = ['local', 'session', 'sync'];
736
+ if (isGranted && obj && areas.includes(area)) {
697
737
  const { storage } = browser;
698
- await storage.local.set(obj);
738
+ await storage[area]?.set(obj);
699
739
  }
700
740
  };
701
741
 
@@ -813,7 +853,7 @@ export const execScriptsToTabInOrder = async (tabId, opts = []) => {
813
853
  const { value } = await Promise.allSettled(func).then(a => a.pop());
814
854
  res = value;
815
855
  }
816
- return res || null;
856
+ return res ?? null;
817
857
  };
818
858
 
819
859
  /**
@@ -844,8 +884,12 @@ export const getActiveTabId = async windowId => {
844
884
  if (!Number.isInteger(windowId)) {
845
885
  windowId = windows.WINDOW_ID_CURRENT;
846
886
  }
847
- const { id } = await getActiveTab(windowId);
848
- return id;
887
+ const tab = await getActiveTab(windowId);
888
+ let tabId;
889
+ if (tab) {
890
+ tabId = tab.id;
891
+ }
892
+ return Number.isInteger(tabId) ? tabId : null;
849
893
  };
850
894
 
851
895
  /**
@@ -934,7 +978,7 @@ export const moveTab = async (tabId, opt) => {
934
978
  if (arr && !Array.isArray(arr)) {
935
979
  arr = [arr];
936
980
  }
937
- return arr || null;
981
+ return arr ?? null;
938
982
  };
939
983
 
940
984
  /**
@@ -1033,7 +1077,7 @@ export const getCurrentTheme = async () => {
1033
1077
  const { theme } = browser;
1034
1078
  currentTheme = await theme.getCurrent();
1035
1079
  }
1036
- return currentTheme || null;
1080
+ return currentTheme ?? null;
1037
1081
  };
1038
1082
 
1039
1083
  /* windows */
package/package.json CHANGED
@@ -38,15 +38,15 @@
38
38
  "devDependencies": {
39
39
  "c8": "^7.12.0",
40
40
  "chai": "^4.3.6",
41
- "eslint": "^8.21.0",
41
+ "eslint": "^8.22.0",
42
42
  "eslint-config-standard": "^17.0.0",
43
43
  "eslint-plugin-import": "^2.26.0",
44
- "eslint-plugin-jsdoc": "^39.3.4",
44
+ "eslint-plugin-jsdoc": "^39.3.6",
45
45
  "eslint-plugin-node": "^11.1.0",
46
46
  "eslint-plugin-promise": "^6.0.0",
47
47
  "mocha": "^10.0.0",
48
48
  "nock": "^13.2.9",
49
49
  "npm-run-all": "^4.1.5"
50
50
  },
51
- "version": "4.1.3"
51
+ "version": "5.0.0"
52
52
  }
@@ -9620,6 +9620,154 @@
9620
9620
  ]
9621
9621
  }
9622
9622
  ],
9623
+ "declarative_net_request.json": [
9624
+ {
9625
+ "namespace": "manifest",
9626
+ "types": [
9627
+ {
9628
+ "$extend": "Permission",
9629
+ "choices": [
9630
+ {
9631
+ "type": "string",
9632
+ "enum": [
9633
+ "declarativeNetRequest"
9634
+ ],
9635
+ "min_manifest_version": 3
9636
+ }
9637
+ ]
9638
+ },
9639
+ {
9640
+ "$extend": "PermissionNoPrompt",
9641
+ "choices": [
9642
+ {
9643
+ "type": "string",
9644
+ "enum": [
9645
+ "declarativeNetRequestFeedback",
9646
+ "declarativeNetRequestWithHostAccess"
9647
+ ],
9648
+ "min_manifest_version": 3
9649
+ }
9650
+ ]
9651
+ }
9652
+ ]
9653
+ },
9654
+ {
9655
+ "namespace": "declarativeNetRequest",
9656
+ "description": "Use the declarativeNetRequest API to block or modify network requests by specifying declarative rules.",
9657
+ "permissions": [
9658
+ "declarativeNetRequest",
9659
+ "declarativeNetRequestWithHostAccess"
9660
+ ],
9661
+ "types": [
9662
+ {
9663
+ "id": "ResourceType",
9664
+ "type": "string",
9665
+ "description": "How the requested resource will be used. Comparable to the webRequest.ResourceType type.",
9666
+ "enum": [
9667
+ "main_frame",
9668
+ "sub_frame",
9669
+ "stylesheet",
9670
+ "script",
9671
+ "image",
9672
+ "object",
9673
+ "object_subrequest",
9674
+ "xmlhttprequest",
9675
+ "xslt",
9676
+ "ping",
9677
+ "beacon",
9678
+ "xml_dtd",
9679
+ "font",
9680
+ "media",
9681
+ "websocket",
9682
+ "csp_report",
9683
+ "imageset",
9684
+ "web_manifest",
9685
+ "speculative",
9686
+ "other"
9687
+ ]
9688
+ },
9689
+ {
9690
+ "id": "MatchedRule",
9691
+ "type": "object",
9692
+ "properties": {
9693
+ "ruleId": {
9694
+ "type": "integer",
9695
+ "description": "A matching rule's ID."
9696
+ },
9697
+ "rulesetId": {
9698
+ "type": "string",
9699
+ "description": "ID of the Ruleset this rule belongs to."
9700
+ }
9701
+ }
9702
+ }
9703
+ ],
9704
+ "functions": [
9705
+ {
9706
+ "name": "testMatchOutcome",
9707
+ "type": "function",
9708
+ "description": "Checks if any of the extension's declarativeNetRequest rules would match a hypothetical request.",
9709
+ "permissions": [
9710
+ "declarativeNetRequestFeedback"
9711
+ ],
9712
+ "async": "callback",
9713
+ "parameters": [
9714
+ {
9715
+ "name": "request",
9716
+ "type": "object",
9717
+ "description": "The details of the request to test.",
9718
+ "properties": {
9719
+ "url": {
9720
+ "type": "string",
9721
+ "description": "The URL of the hypothetical request."
9722
+ },
9723
+ "initiator": {
9724
+ "type": "string",
9725
+ "description": "The initiator URL (if any) for the hypothetical request.",
9726
+ "optional": true
9727
+ },
9728
+ "method": {
9729
+ "type": "string",
9730
+ "description": "Standard HTTP method of the hypothetical request.",
9731
+ "optional": true,
9732
+ "default": "get"
9733
+ },
9734
+ "type": {
9735
+ "$ref": "ResourceType",
9736
+ "description": "The resource type of the hypothetical request."
9737
+ },
9738
+ "tabId": {
9739
+ "type": "integer",
9740
+ "description": "The ID of the tab in which the hypothetical request takes place. Does not need to correspond to a real tab ID. Default is -1, meaning that the request isn't related to a tab.",
9741
+ "optional": true,
9742
+ "default": -1
9743
+ }
9744
+ }
9745
+ },
9746
+ {
9747
+ "name": "callback",
9748
+ "type": "function",
9749
+ "description": "Called with the details of matched rules.",
9750
+ "parameters": [
9751
+ {
9752
+ "name": "result",
9753
+ "type": "object",
9754
+ "properties": {
9755
+ "matchedRules": {
9756
+ "type": "array",
9757
+ "description": "The rules (if any) that match the hypothetical request.",
9758
+ "items": {
9759
+ "$ref": "MatchedRule"
9760
+ }
9761
+ }
9762
+ }
9763
+ }
9764
+ ]
9765
+ }
9766
+ ]
9767
+ }
9768
+ ]
9769
+ }
9770
+ ],
9623
9771
  "dns.json": [
9624
9772
  {
9625
9773
  "namespace": "manifest",
@@ -11577,7 +11725,6 @@
11577
11725
  "enum": [
11578
11726
  "java",
11579
11727
  "js",
11580
- "leaf",
11581
11728
  "mainthreadio",
11582
11729
  "fileio",
11583
11730
  "fileioall",
@@ -3991,64 +3991,79 @@
3991
3991
  {
3992
3992
  "namespace": "manifest",
3993
3993
  "types": [
3994
+ {
3995
+ "id": "ActionManifest",
3996
+ "type": "object",
3997
+ "additionalProperties": {
3998
+ "$ref": "UnrecognizedProperty"
3999
+ },
4000
+ "properties": {
4001
+ "default_label": {
4002
+ "type": "string",
4003
+ "description": "The label of the action, defaults to its title. Can be set to an empty string to not display any label. If the containing toolbar is configured to display text only, the title will be used as fallback.",
4004
+ "optional": true,
4005
+ "preprocess": "localize"
4006
+ },
4007
+ "default_title": {
4008
+ "type": "string",
4009
+ "description": "The title of the action. This shows up in the tooltip and the label. Defaults to the add-on name.",
4010
+ "optional": true,
4011
+ "preprocess": "localize"
4012
+ },
4013
+ "default_icon": {
4014
+ "$ref": "IconPath",
4015
+ "description": "The icon for the action.",
4016
+ "optional": true
4017
+ },
4018
+ "theme_icons": {
4019
+ "type": "array",
4020
+ "optional": true,
4021
+ "minItems": 1,
4022
+ "items": {
4023
+ "$ref": "ThemeIcons"
4024
+ },
4025
+ "description": "Specifies dark and light icons to be used with themes. The ``light`` icon is used on dark backgrounds and vice versa. **Note:** The default theme uses the ``default_icon`` for light backgrounds (if specified)."
4026
+ },
4027
+ "default_popup": {
4028
+ "type": "string",
4029
+ "format": "relativeUrl",
4030
+ "optional": true,
4031
+ "description": "The html document to be opened as a popup when the user clicks on the action's icon.",
4032
+ "preprocess": "localize"
4033
+ },
4034
+ "browser_style": {
4035
+ "type": "boolean",
4036
+ "optional": true,
4037
+ "description": "Enable browser styles. See the `MDN documentation on browser styles <https://developer.mozilla.org/docs/Mozilla/Add-ons/WebExtensions/user_interface/Browser_styles>`__ for more information.",
4038
+ "default": false
4039
+ },
4040
+ "default_area": {
4041
+ "description": "Defines the location the action will appear. The default location is ``maintoolbar``.",
4042
+ "type": "string",
4043
+ "enum": [
4044
+ "maintoolbar",
4045
+ "tabstoolbar"
4046
+ ],
4047
+ "optional": true
4048
+ }
4049
+ }
4050
+ },
4051
+ {
4052
+ "$extend": "WebExtensionManifest",
4053
+ "properties": {
4054
+ "action": {
4055
+ "min_manifest_version": 3,
4056
+ "$ref": "ActionManifest",
4057
+ "optional": true
4058
+ }
4059
+ }
4060
+ },
3994
4061
  {
3995
4062
  "$extend": "WebExtensionManifest",
3996
4063
  "properties": {
3997
4064
  "browser_action": {
3998
- "type": "object",
3999
- "additionalProperties": {
4000
- "$ref": "UnrecognizedProperty"
4001
- },
4002
- "properties": {
4003
- "default_label": {
4004
- "type": "string",
4005
- "description": "The label of the browserAction, defaults to its title. Can be set to an empty string to not display any label. If the containing toolbar is configured to display text only, the title will be used as fallback.",
4006
- "optional": true,
4007
- "preprocess": "localize"
4008
- },
4009
- "default_title": {
4010
- "type": "string",
4011
- "description": "The title of the browserAction. This shows up in the tooltip and the label. Defaults to the add-on name.",
4012
- "optional": true,
4013
- "preprocess": "localize"
4014
- },
4015
- "default_icon": {
4016
- "$ref": "IconPath",
4017
- "description": "The icon for the messageDisplayAction.",
4018
- "optional": true
4019
- },
4020
- "theme_icons": {
4021
- "type": "array",
4022
- "optional": true,
4023
- "minItems": 1,
4024
- "items": {
4025
- "$ref": "ThemeIcons"
4026
- },
4027
- "description": "Specifies dark and light icons to be used with themes. The ``light`` icon is used on dark backgrounds and vice versa. **Note:** The default theme uses the ``default_icon`` for light backgrounds (if specified)."
4028
- },
4029
- "default_popup": {
4030
- "type": "string",
4031
- "format": "relativeUrl",
4032
- "optional": true,
4033
- "description": "The html document to be opened as a popup when the user clicks on the browserAction's icon.",
4034
- "preprocess": "localize"
4035
- },
4036
- "browser_style": {
4037
- "type": "boolean",
4038
- "optional": true,
4039
- "description": "Enable browser styles. See the `MDN documentation on browser styles <https://developer.mozilla.org/docs/Mozilla/Add-ons/WebExtensions/user_interface/Browser_styles>`__ for more information.",
4040
- "default": false
4041
- },
4042
- "default_area": {
4043
- "description": "Defines the location the browserAction will appear. The default location is ``maintoolbar``.",
4044
- "type": "string",
4045
- "enum": [
4046
- "maintoolbar",
4047
- "tabstoolbar"
4048
- ],
4049
- "optional": true
4050
- }
4051
- },
4065
+ "max_manifest_version": 2,
4066
+ "$ref": "ActionManifest",
4052
4067
  "optional": true
4053
4068
  }
4054
4069
  }
@@ -4056,11 +4071,13 @@
4056
4071
  ]
4057
4072
  },
4058
4073
  {
4059
- "namespace": "browserAction",
4060
- "description": "Use a browserAction to put an icon in the mail window toolbar. In addition to its icon, a browserAction can also have a tooltip, a badge, and a popup. This namespace is called browserAction for compatibility with browser WebExtensions.",
4074
+ "namespace": "action",
4075
+ "description": "Use an action to put an icon in the mail window toolbar. In addition to its icon, an action can also have a tooltip, a badge, and a popup.",
4061
4076
  "permissions": [
4077
+ "manifest:action",
4062
4078
  "manifest:browser_action"
4063
4079
  ],
4080
+ "min_manifest_version": 3,
4064
4081
  "types": [
4065
4082
  {
4066
4083
  "id": "Details",
@@ -4144,7 +4161,7 @@
4144
4161
  {
4145
4162
  "name": "setTitle",
4146
4163
  "type": "function",
4147
- "description": "Sets the title of the browserAction. This shows up in the tooltip and the label. Defaults to the add-on name.",
4164
+ "description": "Sets the title of the action. This shows up in the tooltip and the label. Defaults to the add-on name.",
4148
4165
  "async": "callback",
4149
4166
  "parameters": [
4150
4167
  {
@@ -4161,7 +4178,7 @@
4161
4178
  "type": "null"
4162
4179
  }
4163
4180
  ],
4164
- "description": "The string the browserAction should display as its label and when moused over."
4181
+ "description": "The string the action should display as its label and when moused over."
4165
4182
  }
4166
4183
  }
4167
4184
  },
@@ -4176,7 +4193,7 @@
4176
4193
  {
4177
4194
  "name": "getTitle",
4178
4195
  "type": "function",
4179
- "description": "Gets the title of the browserAction.",
4196
+ "description": "Gets the title of the action.",
4180
4197
  "async": "callback",
4181
4198
  "parameters": [
4182
4199
  {
@@ -4198,7 +4215,7 @@
4198
4215
  {
4199
4216
  "name": "setLabel",
4200
4217
  "type": "function",
4201
- "description": "Sets the label of the browserAction, defaults to its title. Can be set to an empty string to not display any label. If the containing toolbar is configured to display text only, the title will be used as fallback.",
4218
+ "description": "Sets the label of the action, defaults to its title. Can be set to an empty string to not display any label. If the containing toolbar is configured to display text only, the title will be used as fallback.",
4202
4219
  "async": "callback",
4203
4220
  "parameters": [
4204
4221
  {
@@ -4215,7 +4232,7 @@
4215
4232
  "type": "null"
4216
4233
  }
4217
4234
  ],
4218
- "description": "The string the browserAction should use as label. Can be set to an empty string to not display any label. If the containing toolbar is configured to display text only, the title will be used as fallback."
4235
+ "description": "The string the action should use as label. Can be set to an empty string to not display any label. If the containing toolbar is configured to display text only, the title will be used as fallback."
4219
4236
  }
4220
4237
  }
4221
4238
  },
@@ -4230,7 +4247,7 @@
4230
4247
  {
4231
4248
  "name": "getLabel",
4232
4249
  "type": "function",
4233
- "description": "Gets the label of the browserAction.",
4250
+ "description": "Gets the label of the action.",
4234
4251
  "async": "callback",
4235
4252
  "parameters": [
4236
4253
  {
@@ -4252,7 +4269,7 @@
4252
4269
  {
4253
4270
  "name": "setIcon",
4254
4271
  "type": "function",
4255
- "description": "Sets the icon for the browserAction. The icon can be specified either as the path to an image file or as the pixel data from a canvas element, or as dictionary of either one of those. Either the <b>path</b> or the <b>imageData</b> property must be specified.",
4272
+ "description": "Sets the icon for the action. The icon can be specified either as the path to an image file or as the pixel data from a canvas element, or as dictionary of either one of those. Either the <b>path</b> or the <b>imageData</b> property must be specified.",
4256
4273
  "async": "callback",
4257
4274
  "parameters": [
4258
4275
  {
@@ -4297,7 +4314,7 @@
4297
4314
  {
4298
4315
  "name": "setPopup",
4299
4316
  "type": "function",
4300
- "description": "Sets the html document to be opened as a popup when the user clicks on the browserAction's icon.",
4317
+ "description": "Sets the html document to be opened as a popup when the user clicks on the action's icon.",
4301
4318
  "async": "callback",
4302
4319
  "parameters": [
4303
4320
  {
@@ -4329,7 +4346,7 @@
4329
4346
  {
4330
4347
  "name": "getPopup",
4331
4348
  "type": "function",
4332
- "description": "Gets the html document set as the popup for this browserAction.",
4349
+ "description": "Gets the html document set as the popup for this action.",
4333
4350
  "async": "callback",
4334
4351
  "parameters": [
4335
4352
  {
@@ -4351,7 +4368,7 @@
4351
4368
  {
4352
4369
  "name": "setBadgeText",
4353
4370
  "type": "function",
4354
- "description": "Sets the badge text for the browserAction. The badge is displayed on top of the icon.",
4371
+ "description": "Sets the badge text for the action. The badge is displayed on top of the icon.",
4355
4372
  "async": "callback",
4356
4373
  "parameters": [
4357
4374
  {
@@ -4383,7 +4400,7 @@
4383
4400
  {
4384
4401
  "name": "getBadgeText",
4385
4402
  "type": "function",
4386
- "description": "Gets the badge text of the browserAction. If no tab nor window is specified, the global badge text is returned.",
4403
+ "description": "Gets the badge text of the action. If no tab nor window is specified, the global badge text is returned.",
4387
4404
  "async": "callback",
4388
4405
  "parameters": [
4389
4406
  {
@@ -4440,7 +4457,7 @@
4440
4457
  {
4441
4458
  "name": "getBadgeBackgroundColor",
4442
4459
  "type": "function",
4443
- "description": "Gets the background color of the browserAction.",
4460
+ "description": "Gets the background color of the action.",
4444
4461
  "async": "callback",
4445
4462
  "parameters": [
4446
4463
  {
@@ -4462,7 +4479,7 @@
4462
4479
  {
4463
4480
  "name": "enable",
4464
4481
  "type": "function",
4465
- "description": "Enables the browserAction for a tab. By default, a browserAction is enabled.",
4482
+ "description": "Enables the action for a tab. By default, an action is enabled.",
4466
4483
  "async": "callback",
4467
4484
  "parameters": [
4468
4485
  {
@@ -4470,7 +4487,7 @@
4470
4487
  "optional": true,
4471
4488
  "name": "tabId",
4472
4489
  "minimum": 0,
4473
- "description": "The id of the tab for which you want to modify the browserAction."
4490
+ "description": "The id of the tab for which you want to modify the action."
4474
4491
  },
4475
4492
  {
4476
4493
  "type": "function",
@@ -4483,7 +4500,7 @@
4483
4500
  {
4484
4501
  "name": "disable",
4485
4502
  "type": "function",
4486
- "description": "Disables the browserAction for a tab.",
4503
+ "description": "Disables the action for a tab.",
4487
4504
  "async": "callback",
4488
4505
  "parameters": [
4489
4506
  {
@@ -4491,7 +4508,7 @@
4491
4508
  "optional": true,
4492
4509
  "name": "tabId",
4493
4510
  "minimum": 0,
4494
- "description": "The id of the tab for which you want to modify the browserAction."
4511
+ "description": "The id of the tab for which you want to modify the action."
4495
4512
  },
4496
4513
  {
4497
4514
  "type": "function",
@@ -4504,7 +4521,7 @@
4504
4521
  {
4505
4522
  "name": "isEnabled",
4506
4523
  "type": "function",
4507
- "description": "Checks whether the browserAction is enabled.",
4524
+ "description": "Checks whether the action is enabled.",
4508
4525
  "async": "callback",
4509
4526
  "parameters": [
4510
4527
  {
@@ -4536,7 +4553,7 @@
4536
4553
  {
4537
4554
  "name": "onClicked",
4538
4555
  "type": "function",
4539
- "description": "Fired when a browserAction icon is clicked. This event will not fire if the browserAction has a popup. This is a user input event handler. For asynchronous listeners some `restrictions <https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/User_actions>`__ apply.",
4556
+ "description": "Fired when an action icon is clicked. This event will not fire if the action has a popup. This is a user input event handler. For asynchronous listeners some `restrictions <https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/User_actions>`__ apply.",
4540
4557
  "parameters": [
4541
4558
  {
4542
4559
  "name": "tab",
@@ -4550,6 +4567,15 @@
4550
4567
  ]
4551
4568
  }
4552
4569
  ]
4570
+ },
4571
+ {
4572
+ "namespace": "browserAction",
4573
+ "permissions": [
4574
+ "manifest:action",
4575
+ "manifest:browser_action"
4576
+ ],
4577
+ "max_manifest_version": 2,
4578
+ "$import": "action"
4553
4579
  }
4554
4580
  ],
4555
4581
  "chrome_settings_overrides.json": [
@@ -5621,6 +5647,91 @@
5621
5647
  }
5622
5648
  }
5623
5649
  },
5650
+ {
5651
+ "name": "onAfterSend",
5652
+ "type": "function",
5653
+ "description": "Fired when sending a message succeeded or failed.",
5654
+ "permissions": [
5655
+ "compose"
5656
+ ],
5657
+ "parameters": [
5658
+ {
5659
+ "name": "tab",
5660
+ "$ref": "tabs.Tab"
5661
+ },
5662
+ {
5663
+ "name": "sendInfo",
5664
+ "type": "object",
5665
+ "properties": {
5666
+ "mode": {
5667
+ "type": "string",
5668
+ "description": "The used send mode.",
5669
+ "enum": [
5670
+ "sendNow",
5671
+ "sendLater"
5672
+ ]
5673
+ },
5674
+ "error": {
5675
+ "type": "string",
5676
+ "description": "An error description, if sending the message failed.",
5677
+ "optional": true
5678
+ },
5679
+ "headerMessageId": {
5680
+ "type": "string",
5681
+ "description": "The header messageId of the outgoing message. Only included for actually sent messages.",
5682
+ "optional": true
5683
+ },
5684
+ "messages": {
5685
+ "type": "array",
5686
+ "items": {
5687
+ "$ref": "messages.MessageHeader"
5688
+ },
5689
+ "description": "Copies of the sent message. The number of created copies depends on the applied file carbon copy configuration (fcc)."
5690
+ }
5691
+ }
5692
+ }
5693
+ ]
5694
+ },
5695
+ {
5696
+ "name": "onAfterSave",
5697
+ "type": "function",
5698
+ "description": "Fired when saving a message as draft or template succeeded or failed.",
5699
+ "permissions": [
5700
+ "compose"
5701
+ ],
5702
+ "parameters": [
5703
+ {
5704
+ "name": "tab",
5705
+ "$ref": "tabs.Tab"
5706
+ },
5707
+ {
5708
+ "name": "saveInfo",
5709
+ "type": "object",
5710
+ "properties": {
5711
+ "mode": {
5712
+ "type": "string",
5713
+ "description": "The used save mode.",
5714
+ "enum": [
5715
+ "draft",
5716
+ "template"
5717
+ ]
5718
+ },
5719
+ "error": {
5720
+ "type": "string",
5721
+ "description": "An error description, if saving the message failed.",
5722
+ "optional": true
5723
+ },
5724
+ "messages": {
5725
+ "type": "array",
5726
+ "items": {
5727
+ "$ref": "messages.MessageHeader"
5728
+ },
5729
+ "description": "The saved message(s). The number of saved messages depends on the applied file carbon copy configuration (fcc)."
5730
+ }
5731
+ }
5732
+ }
5733
+ ]
5734
+ },
5624
5735
  {
5625
5736
  "name": "onAttachmentAdded",
5626
5737
  "type": "function",
@@ -11587,7 +11587,6 @@
11587
11587
  "screenshots",
11588
11588
  "seqstyle",
11589
11589
  "stackwalk",
11590
- "jstracer",
11591
11590
  "jsallocations",
11592
11591
  "nostacksampling",
11593
11592
  "preferencereads",
@@ -11601,6 +11600,7 @@
11601
11600
  "markersallthreads",
11602
11601
  "unregisteredthreads",
11603
11602
  "processcpu",
11603
+ "power",
11604
11604
  "responsiveness"
11605
11605
  ]
11606
11606
  },
@@ -12892,7 +12892,7 @@
12892
12892
  "matches": {
12893
12893
  "type": "array",
12894
12894
  "items": {
12895
- "$ref": "MatchPatternRestricted"
12895
+ "$ref": "MatchPattern"
12896
12896
  }
12897
12897
  }
12898
12898
  }
@@ -19320,6 +19320,8 @@
19320
19320
  "fingerprinting_content",
19321
19321
  "cryptomining",
19322
19322
  "cryptomining_content",
19323
+ "emailtracking",
19324
+ "emailtracking_content",
19323
19325
  "tracking",
19324
19326
  "tracking_ad",
19325
19327
  "tracking_analytics",