webext-schema 4.2.0 → 5.0.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/browser.js +79 -49
- package/package.json +1 -1
- package/schemas/beta/webext.json +183 -15
- package/schemas/central/webext.json +294 -2
- package/schemas/release/webext.json +4 -2
package/modules/browser.js
CHANGED
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
-
|
|
205
|
-
arr = await contextualIdentities.query({});
|
|
206
|
-
} catch (e) {
|
|
207
|
-
logErr(e);
|
|
208
|
-
}
|
|
204
|
+
arr = await contextualIdentities.query({});
|
|
209
205
|
}
|
|
210
|
-
return arr
|
|
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
|
-
|
|
230
|
-
id = await contextualIdentities.get(cookieStoreId);
|
|
231
|
-
} catch (e) {
|
|
232
|
-
logErr(e);
|
|
233
|
-
}
|
|
225
|
+
id = await contextualIdentities.get(cookieStoreId);
|
|
234
226
|
}
|
|
235
|
-
return id
|
|
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
|
-
|
|
252
|
-
|
|
253
|
-
|
|
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
|
|
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
|
|
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
|
-
|
|
298
|
-
|
|
299
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
622
|
+
return ses ?? null;
|
|
593
623
|
};
|
|
594
624
|
|
|
595
625
|
/**
|
|
@@ -650,7 +680,7 @@ export const getAllStorage = async (area = 'local') => {
|
|
|
650
680
|
const { storage } = browser;
|
|
651
681
|
data = await storage[area]?.get();
|
|
652
682
|
}
|
|
653
|
-
return data
|
|
683
|
+
return data ?? null;
|
|
654
684
|
};
|
|
655
685
|
|
|
656
686
|
/**
|
|
@@ -670,7 +700,7 @@ export const getStorage = async (key, area = 'local') => {
|
|
|
670
700
|
const { storage } = browser;
|
|
671
701
|
data = await storage[area]?.get(key);
|
|
672
702
|
}
|
|
673
|
-
return data
|
|
703
|
+
return data ?? null;
|
|
674
704
|
};
|
|
675
705
|
|
|
676
706
|
/**
|
|
@@ -823,7 +853,7 @@ export const execScriptsToTabInOrder = async (tabId, opts = []) => {
|
|
|
823
853
|
const { value } = await Promise.allSettled(func).then(a => a.pop());
|
|
824
854
|
res = value;
|
|
825
855
|
}
|
|
826
|
-
return res
|
|
856
|
+
return res ?? null;
|
|
827
857
|
};
|
|
828
858
|
|
|
829
859
|
/**
|
|
@@ -948,7 +978,7 @@ export const moveTab = async (tabId, opt) => {
|
|
|
948
978
|
if (arr && !Array.isArray(arr)) {
|
|
949
979
|
arr = [arr];
|
|
950
980
|
}
|
|
951
|
-
return arr
|
|
981
|
+
return arr ?? null;
|
|
952
982
|
};
|
|
953
983
|
|
|
954
984
|
/**
|
|
@@ -1047,7 +1077,7 @@ export const getCurrentTheme = async () => {
|
|
|
1047
1077
|
const { theme } = browser;
|
|
1048
1078
|
currentTheme = await theme.getCurrent();
|
|
1049
1079
|
}
|
|
1050
|
-
return currentTheme
|
|
1080
|
+
return currentTheme ?? null;
|
|
1051
1081
|
};
|
|
1052
1082
|
|
|
1053
1083
|
/* windows */
|
package/package.json
CHANGED
package/schemas/beta/webext.json
CHANGED
|
@@ -7000,14 +7000,12 @@
|
|
|
7000
7000
|
"optional": true,
|
|
7001
7001
|
"choices": [
|
|
7002
7002
|
{
|
|
7003
|
-
"type": "string"
|
|
7004
|
-
"format": "relativeUrl"
|
|
7003
|
+
"type": "string"
|
|
7005
7004
|
},
|
|
7006
7005
|
{
|
|
7007
7006
|
"type": "array",
|
|
7008
7007
|
"items": {
|
|
7009
|
-
"type": "string"
|
|
7010
|
-
"format": "relativeUrl"
|
|
7008
|
+
"type": "string"
|
|
7011
7009
|
}
|
|
7012
7010
|
}
|
|
7013
7011
|
]
|
|
@@ -9622,6 +9620,154 @@
|
|
|
9622
9620
|
]
|
|
9623
9621
|
}
|
|
9624
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
|
+
],
|
|
9625
9771
|
"dns.json": [
|
|
9626
9772
|
{
|
|
9627
9773
|
"namespace": "manifest",
|
|
@@ -11579,7 +11725,6 @@
|
|
|
11579
11725
|
"enum": [
|
|
11580
11726
|
"java",
|
|
11581
11727
|
"js",
|
|
11582
|
-
"leaf",
|
|
11583
11728
|
"mainthreadio",
|
|
11584
11729
|
"fileio",
|
|
11585
11730
|
"fileioall",
|
|
@@ -12880,20 +13025,43 @@
|
|
|
12880
13025
|
{
|
|
12881
13026
|
"min_manifest_version": 3,
|
|
12882
13027
|
"type": "array",
|
|
13028
|
+
"postprocess": "webAccessibleMatching",
|
|
13029
|
+
"minItems": 1,
|
|
12883
13030
|
"items": {
|
|
12884
13031
|
"type": "object",
|
|
12885
13032
|
"properties": {
|
|
12886
13033
|
"resources": {
|
|
12887
13034
|
"type": "array",
|
|
13035
|
+
"minItems": 1,
|
|
12888
13036
|
"items": {
|
|
12889
13037
|
"type": "string"
|
|
12890
13038
|
}
|
|
12891
13039
|
},
|
|
12892
13040
|
"matches": {
|
|
13041
|
+
"optional": true,
|
|
12893
13042
|
"type": "array",
|
|
13043
|
+
"minItems": 1,
|
|
12894
13044
|
"items": {
|
|
12895
13045
|
"$ref": "MatchPattern"
|
|
12896
13046
|
}
|
|
13047
|
+
},
|
|
13048
|
+
"extension_ids": {
|
|
13049
|
+
"optional": true,
|
|
13050
|
+
"type": "array",
|
|
13051
|
+
"minItems": 1,
|
|
13052
|
+
"items": {
|
|
13053
|
+
"choices": [
|
|
13054
|
+
{
|
|
13055
|
+
"$ref": "ExtensionID"
|
|
13056
|
+
},
|
|
13057
|
+
{
|
|
13058
|
+
"type": "string",
|
|
13059
|
+
"enum": [
|
|
13060
|
+
"*"
|
|
13061
|
+
]
|
|
13062
|
+
}
|
|
13063
|
+
]
|
|
13064
|
+
}
|
|
12897
13065
|
}
|
|
12898
13066
|
}
|
|
12899
13067
|
}
|
|
@@ -15941,10 +16109,9 @@
|
|
|
15941
16109
|
},
|
|
15942
16110
|
"persistAcrossSessions": {
|
|
15943
16111
|
"type": "boolean",
|
|
15944
|
-
"
|
|
15945
|
-
|
|
15946
|
-
|
|
15947
|
-
"description": "Specifies if this content script will persist into future sessions. This is currently NOT supported."
|
|
16112
|
+
"optional": true,
|
|
16113
|
+
"default": true,
|
|
16114
|
+
"description": "Specifies if this content script will persist into future sessions. Defaults to true."
|
|
15948
16115
|
},
|
|
15949
16116
|
"css": {
|
|
15950
16117
|
"type": "array",
|
|
@@ -16110,10 +16277,7 @@
|
|
|
16110
16277
|
"persistAcrossSessions": {
|
|
16111
16278
|
"type": "boolean",
|
|
16112
16279
|
"optional": true,
|
|
16113
|
-
"
|
|
16114
|
-
false
|
|
16115
|
-
],
|
|
16116
|
-
"description": "Specifies if this content script will persist into future sessions. This is currently NOT supported."
|
|
16280
|
+
"description": "Specifies if this content script will persist into future sessions."
|
|
16117
16281
|
}
|
|
16118
16282
|
}
|
|
16119
16283
|
}
|
|
@@ -17264,9 +17428,8 @@
|
|
|
17264
17428
|
]
|
|
17265
17429
|
},
|
|
17266
17430
|
{
|
|
17267
|
-
"name": "
|
|
17431
|
+
"name": "assertDeepEq",
|
|
17268
17432
|
"type": "function",
|
|
17269
|
-
"unsupported": true,
|
|
17270
17433
|
"allowAmbiguousOptionalArguments": true,
|
|
17271
17434
|
"parameters": [
|
|
17272
17435
|
{
|
|
@@ -17276,6 +17439,11 @@
|
|
|
17276
17439
|
{
|
|
17277
17440
|
"type": "any",
|
|
17278
17441
|
"name": "actual"
|
|
17442
|
+
},
|
|
17443
|
+
{
|
|
17444
|
+
"type": "string",
|
|
17445
|
+
"name": "message",
|
|
17446
|
+
"optional": true
|
|
17279
17447
|
}
|
|
17280
17448
|
]
|
|
17281
17449
|
},
|
|
@@ -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",
|
|
@@ -17428,9 +17716,8 @@
|
|
|
17428
17716
|
]
|
|
17429
17717
|
},
|
|
17430
17718
|
{
|
|
17431
|
-
"name": "
|
|
17719
|
+
"name": "assertDeepEq",
|
|
17432
17720
|
"type": "function",
|
|
17433
|
-
"unsupported": true,
|
|
17434
17721
|
"allowAmbiguousOptionalArguments": true,
|
|
17435
17722
|
"parameters": [
|
|
17436
17723
|
{
|
|
@@ -17440,6 +17727,11 @@
|
|
|
17440
17727
|
{
|
|
17441
17728
|
"type": "any",
|
|
17442
17729
|
"name": "actual"
|
|
17730
|
+
},
|
|
17731
|
+
{
|
|
17732
|
+
"type": "string",
|
|
17733
|
+
"name": "message",
|
|
17734
|
+
"optional": true
|
|
17443
17735
|
}
|
|
17444
17736
|
]
|
|
17445
17737
|
},
|
|
@@ -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": "
|
|
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",
|