@adguard/agtree 1.1.6 → 1.1.7
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/CHANGELOG.md +7 -0
- package/dist/agtree.cjs +133 -83
- package/dist/agtree.d.ts +1 -1
- package/dist/agtree.esm.js +133 -83
- package/dist/agtree.iife.min.js +4 -4
- package/dist/agtree.umd.min.js +4 -4
- package/dist/build.txt +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog][keepachangelog], and this project adheres to [Semantic Versioning][semver].
|
|
6
6
|
|
|
7
7
|
|
|
8
|
+
## 1.1.7 - 2023-11-07
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- Support of `referrerpolicy` modifier [#98](https://github.com/AdguardTeam/tsurlfilter/issues/98)
|
|
13
|
+
|
|
14
|
+
|
|
8
15
|
## 1.1.6 - 2023-09-22
|
|
9
16
|
|
|
10
17
|
### Changed
|
package/dist/agtree.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* AGTree v1.1.
|
|
2
|
+
* AGTree v1.1.7 (build date: Tue, 07 Nov 2023 14:17:46 GMT)
|
|
3
3
|
* (c) 2023 AdGuard Software Ltd.
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
|
|
@@ -6281,7 +6281,7 @@ class RuleConversionError extends Error {
|
|
|
6281
6281
|
}
|
|
6282
6282
|
}
|
|
6283
6283
|
|
|
6284
|
-
var data$
|
|
6284
|
+
var data$U = { adg_os_any:{ name:"all",
|
|
6285
6285
|
description:"$all modifier is made of $document, $popup, and all content-type modifiers combined.",
|
|
6286
6286
|
docs:"https://adguard.app/kb/general/ad-filtering/create-own-filters/#all-modifier",
|
|
6287
6287
|
negatable:false,
|
|
@@ -6307,14 +6307,14 @@ var data$T = { adg_os_any:{ name:"all",
|
|
|
6307
6307
|
negatable:false,
|
|
6308
6308
|
block_only:false } };
|
|
6309
6309
|
|
|
6310
|
-
var data$
|
|
6310
|
+
var data$T = { adg_os_any:{ name:"app",
|
|
6311
6311
|
description:"The `$app` modifier lets you narrow the rule coverage down to a specific application or a list of applications.\nThe modifier's behavior and syntax perfectly match the corresponding basic rules `$app` modifier.",
|
|
6312
6312
|
docs:"https://adguard.app/kb/general/ad-filtering/create-own-filters/#app-modifier",
|
|
6313
6313
|
assignable:true,
|
|
6314
6314
|
negatable:false,
|
|
6315
6315
|
value_format:"pipe_separated_apps" } };
|
|
6316
6316
|
|
|
6317
|
-
var data$
|
|
6317
|
+
var data$S = { adg_os_any:{ name:"badfilter",
|
|
6318
6318
|
description:"The rules with the `$badfilter` modifier disable other basic rules to which they refer. It means that\nthe text of the disabled rule should match the text of the `$badfilter` rule (without the `$badfilter` modifier).",
|
|
6319
6319
|
docs:"https://adguard.app/kb/general/ad-filtering/create-own-filters/#badfilter-modifier",
|
|
6320
6320
|
negatable:false },
|
|
@@ -6335,19 +6335,19 @@ var data$R = { adg_os_any:{ name:"badfilter",
|
|
|
6335
6335
|
docs:"https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#badfilter",
|
|
6336
6336
|
negatable:false } };
|
|
6337
6337
|
|
|
6338
|
-
var data$
|
|
6338
|
+
var data$R = { ubo_ext_any:{ name:"cname",
|
|
6339
6339
|
description:"When used in an exception filter,\nit will bypass blocking CNAME uncloaked requests for the current (specified) document.",
|
|
6340
6340
|
docs:"https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#cname",
|
|
6341
6341
|
negatable:false,
|
|
6342
6342
|
exception_only:true } };
|
|
6343
6343
|
|
|
6344
|
-
var data$
|
|
6344
|
+
var data$Q = { adg_os_any:{ name:"content",
|
|
6345
6345
|
description:"Disables HTML filtering and `$replace` rules on the pages that match the rule.",
|
|
6346
6346
|
docs:"https://adguard.app/kb/general/ad-filtering/create-own-filters/#content-modifier",
|
|
6347
6347
|
negatable:false,
|
|
6348
6348
|
exception_only:true } };
|
|
6349
6349
|
|
|
6350
|
-
var data$
|
|
6350
|
+
var data$P = { adg_os_any:{ name:"cookie",
|
|
6351
6351
|
description:"The `$cookie` modifier completely changes rule behavior.\nInstead of blocking a request, this modifier makes us suppress or modify the Cookie and Set-Cookie headers.",
|
|
6352
6352
|
docs:"https://adguard.app/kb/general/ad-filtering/create-own-filters/#cookie-modifier",
|
|
6353
6353
|
assignable:true,
|
|
@@ -6362,7 +6362,7 @@ var data$O = { adg_os_any:{ name:"cookie",
|
|
|
6362
6362
|
value_optional:true,
|
|
6363
6363
|
value_format:"^([^;=\\s]*?)((?:;(maxAge=\\d+;?)?|(sameSite=(lax|none|strict);?)?){1,3})(?<!;)$" } };
|
|
6364
6364
|
|
|
6365
|
-
var data$
|
|
6365
|
+
var data$O = { adg_os_any:{ name:"csp",
|
|
6366
6366
|
description:"This modifier completely changes the rule behavior.\nIf it is applied to a rule, it will not block the matching request.\nThe response headers are going to be modified instead.",
|
|
6367
6367
|
docs:"https://adguard.app/kb/general/ad-filtering/create-own-filters/#csp-modifier",
|
|
6368
6368
|
conflicts:[ "domain",
|
|
@@ -6409,7 +6409,7 @@ var data$N = { adg_os_any:{ name:"csp",
|
|
|
6409
6409
|
value_optional:true,
|
|
6410
6410
|
value_format:"csp_value" } };
|
|
6411
6411
|
|
|
6412
|
-
var data$
|
|
6412
|
+
var data$N = { adg_os_any:{ name:"denyallow",
|
|
6413
6413
|
description:"The `$denyallow` modifier allows to avoid creating additional rules\nwhen it is needed to disable a certain rule for specific domains.\n`$denyallow` matches only target domains and not referrer domains.",
|
|
6414
6414
|
docs:"https://adguard.app/kb/general/ad-filtering/create-own-filters/#denyallow-modifier",
|
|
6415
6415
|
conflicts:[ "to" ],
|
|
@@ -6445,7 +6445,7 @@ var data$M = { adg_os_any:{ name:"denyallow",
|
|
|
6445
6445
|
negatable:false,
|
|
6446
6446
|
value_format:"pipe_separated_denyallow_domains" } };
|
|
6447
6447
|
|
|
6448
|
-
var data$
|
|
6448
|
+
var data$M = { adg_os_any:{ name:"document",
|
|
6449
6449
|
description:"The rule corresponds to the main frame document requests,\ni.e. HTML documents that are loaded in the browser tab.",
|
|
6450
6450
|
docs:"https://adguard.app/kb/general/ad-filtering/create-own-filters/#document-modifier",
|
|
6451
6451
|
negatable:false },
|
|
@@ -6471,7 +6471,7 @@ var data$L = { adg_os_any:{ name:"document",
|
|
|
6471
6471
|
docs:"https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#document",
|
|
6472
6472
|
negatable:false } };
|
|
6473
6473
|
|
|
6474
|
-
var data$
|
|
6474
|
+
var data$L = { adg_any:{ name:"domain",
|
|
6475
6475
|
aliases:[ "from" ],
|
|
6476
6476
|
description:"The `$domain` modifier limits the rule application area to a list of domains and their subdomains.",
|
|
6477
6477
|
docs:"https://adguard.app/kb/general/ad-filtering/create-own-filters/#domain-modifier",
|
|
@@ -6492,7 +6492,7 @@ var data$K = { adg_any:{ name:"domain",
|
|
|
6492
6492
|
negatable:false,
|
|
6493
6493
|
value_format:"pipe_separated_domains" } };
|
|
6494
6494
|
|
|
6495
|
-
var data$
|
|
6495
|
+
var data$K = { adg_any:{ name:"elemhide",
|
|
6496
6496
|
aliases:[ "ehide" ],
|
|
6497
6497
|
description:"Disables any cosmetic rules on the pages matching the rule.",
|
|
6498
6498
|
docs:"https://adguard.app/kb/general/ad-filtering/create-own-filters/#elemhide-modifier",
|
|
@@ -6511,7 +6511,7 @@ var data$J = { adg_any:{ name:"elemhide",
|
|
|
6511
6511
|
docs:"https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#elemhide-1",
|
|
6512
6512
|
description:"Disables any cosmetic rules on the pages matching the rule." } };
|
|
6513
6513
|
|
|
6514
|
-
var data$
|
|
6514
|
+
var data$J = { adg_os_any:{ name:"empty",
|
|
6515
6515
|
description:"This modifier is deprecated in favor of the $redirect modifier.\nRules with `$empty` are still supported and being converted into `$redirect=nooptext` now\nbut the support shall be removed in the future.",
|
|
6516
6516
|
docs:"https://adguard.app/kb/general/ad-filtering/create-own-filters/#empty-modifier",
|
|
6517
6517
|
deprecated:true,
|
|
@@ -6528,7 +6528,7 @@ var data$I = { adg_os_any:{ name:"empty",
|
|
|
6528
6528
|
docs:"https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#empty",
|
|
6529
6529
|
negatable:false } };
|
|
6530
6530
|
|
|
6531
|
-
var data$
|
|
6531
|
+
var data$I = { adg_any:{ name:"first-party",
|
|
6532
6532
|
aliases:[ "1p",
|
|
6533
6533
|
"~third-party" ],
|
|
6534
6534
|
description:"A restriction of first-party requests. Equal to `~third-party`.",
|
|
@@ -6541,7 +6541,7 @@ var data$H = { adg_any:{ name:"first-party",
|
|
|
6541
6541
|
docs:"https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#1p",
|
|
6542
6542
|
negatable:false } };
|
|
6543
6543
|
|
|
6544
|
-
var data$
|
|
6544
|
+
var data$H = { adg_os_any:{ name:"extension",
|
|
6545
6545
|
description:"Disables all userscripts on the pages matching this rule.",
|
|
6546
6546
|
docs:"https://adguard.app/kb/general/ad-filtering/create-own-filters/#extension-modifier",
|
|
6547
6547
|
conflicts:[ "domain",
|
|
@@ -6557,7 +6557,7 @@ var data$G = { adg_os_any:{ name:"extension",
|
|
|
6557
6557
|
inverse_conflicts:true,
|
|
6558
6558
|
exception_only:true } };
|
|
6559
6559
|
|
|
6560
|
-
var data$
|
|
6560
|
+
var data$G = { adg_any:{ name:"font",
|
|
6561
6561
|
docs:"https://adguard.app/kb/general/ad-filtering/create-own-filters/#font-modifier",
|
|
6562
6562
|
description:"The rule corresponds to requests for fonts, e.g. `.woff` filename extension." },
|
|
6563
6563
|
abp_any:{ name:"font",
|
|
@@ -6567,7 +6567,7 @@ var data$F = { adg_any:{ name:"font",
|
|
|
6567
6567
|
docs:"https://help.adblockplus.org/hc/en-us/articles/360062733293#options",
|
|
6568
6568
|
description:"The rule corresponds to requests for fonts, e.g. `.woff` filename extension." } };
|
|
6569
6569
|
|
|
6570
|
-
var data$
|
|
6570
|
+
var data$F = { adg_os_any:{ name:"genericblock",
|
|
6571
6571
|
description:"Disables generic basic rules on pages that correspond to exception rule.",
|
|
6572
6572
|
docs:"https://adguard.app/kb/general/ad-filtering/create-own-filters/#genericblock-modifier",
|
|
6573
6573
|
conflicts:[ "domain",
|
|
@@ -6623,7 +6623,7 @@ var data$E = { adg_os_any:{ name:"genericblock",
|
|
|
6623
6623
|
negatable:false,
|
|
6624
6624
|
exception_only:true } };
|
|
6625
6625
|
|
|
6626
|
-
var data$
|
|
6626
|
+
var data$E = { adg_any:{ name:"generichide",
|
|
6627
6627
|
aliases:[ "ghide" ],
|
|
6628
6628
|
description:"Disables all generic cosmetic rules.",
|
|
6629
6629
|
docs:"https://adguard.app/kb/general/ad-filtering/create-own-filters/#generichide-modifier",
|
|
@@ -6655,7 +6655,7 @@ var data$D = { adg_any:{ name:"generichide",
|
|
|
6655
6655
|
negatable:false,
|
|
6656
6656
|
exception_only:true } };
|
|
6657
6657
|
|
|
6658
|
-
var data$
|
|
6658
|
+
var data$D = { adg_os_any:{ name:"header",
|
|
6659
6659
|
description:"The `$header` modifier allows matching the HTTP response\nhaving a specific header with (optionally) a specific value.",
|
|
6660
6660
|
docs:"https://adguard.app/kb/general/ad-filtering/create-own-filters/#header-modifier",
|
|
6661
6661
|
assignable:true,
|
|
@@ -6671,7 +6671,7 @@ var data$C = { adg_os_any:{ name:"header",
|
|
|
6671
6671
|
assignable:true,
|
|
6672
6672
|
value_format:"(?xi)\n ^\n # header name\n [\\w-]+\n (\n :\n # header value: string or regexp\n (\\w+|\\/.+\\/)\n )?" } };
|
|
6673
6673
|
|
|
6674
|
-
var data$
|
|
6674
|
+
var data$C = { adg_os_any:{ name:"hls",
|
|
6675
6675
|
description:"The `$hls` rules modify the response of a matching request.\nThey are intended as a convenient way to remove segments from HLS playlists (RFC 8216).",
|
|
6676
6676
|
docs:"https://adguard.app/kb/general/ad-filtering/create-own-filters/#hls-modifier",
|
|
6677
6677
|
version_added:"CoreLibs 1.10",
|
|
@@ -6687,7 +6687,7 @@ var data$B = { adg_os_any:{ name:"hls",
|
|
|
6687
6687
|
value_optional:true,
|
|
6688
6688
|
value_format:"(?xi)\n (\n # string pattern\n \\w+\n # or regexp pattern\n |\n # TODO: improve regexp pattern to invalidate unescaped `/`, `$`, and `,`\n \\/.+\\/\n # options\n ([ti]*)?\n )" } };
|
|
6689
6689
|
|
|
6690
|
-
var data$
|
|
6690
|
+
var data$B = { adg_any:{ name:"image",
|
|
6691
6691
|
description:"The rule corresponds to images requests.",
|
|
6692
6692
|
docs:"https://adguard.app/kb/general/ad-filtering/create-own-filters/#image-modifier" },
|
|
6693
6693
|
abp_any:{ name:"image",
|
|
@@ -6697,7 +6697,7 @@ var data$A = { adg_any:{ name:"image",
|
|
|
6697
6697
|
description:"The rule corresponds to images requests.",
|
|
6698
6698
|
docs:"https://help.adblockplus.org/hc/en-us/articles/360062733293#options" } };
|
|
6699
6699
|
|
|
6700
|
-
var data$
|
|
6700
|
+
var data$A = { adg_any:{ name:"important",
|
|
6701
6701
|
description:"The `$important` modifier applied to a rule increases its priority\nover any other rule without `$important` modifier. Even over basic exception rules.",
|
|
6702
6702
|
docs:"https://adguard.app/kb/general/ad-filtering/create-own-filters/#important-modifier",
|
|
6703
6703
|
negatable:false },
|
|
@@ -6706,7 +6706,7 @@ var data$z = { adg_any:{ name:"important",
|
|
|
6706
6706
|
docs:"https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#important",
|
|
6707
6707
|
negatable:false } };
|
|
6708
6708
|
|
|
6709
|
-
var data$
|
|
6709
|
+
var data$z = { adg_os_any:{ name:"inline-font",
|
|
6710
6710
|
description:"The `$inline-font` modifier is a sort of a shortcut for $csp modifier with specific value.\nE.g. `||example.org^$inline-font` is converting into:\n```adblock\n||example.org^$csp=font-src 'self' 'unsafe-eval' http: https: data: blob: mediastream: filesystem:\n```",
|
|
6711
6711
|
docs:"https://adguard.app/kb/general/ad-filtering/create-own-filters/#inline-font-modifier" },
|
|
6712
6712
|
adg_ext_any:{ name:"inline-font",
|
|
@@ -6716,7 +6716,7 @@ var data$y = { adg_os_any:{ name:"inline-font",
|
|
|
6716
6716
|
description:"The `$inline-font` modifier is a sort of a shortcut for $csp modifier with specific value.\nE.g. `||example.org^$inline-font` is converting into:\n```adblock\n||example.org^$csp=font-src 'self' 'unsafe-eval' http: https: data: blob: mediastream: filesystem:\n```",
|
|
6717
6717
|
docs:"https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#inline-font" } };
|
|
6718
6718
|
|
|
6719
|
-
var data$
|
|
6719
|
+
var data$y = { adg_os_any:{ name:"inline-script",
|
|
6720
6720
|
description:"The `$inline-script` modifier is a sort of a shortcut for $csp modifier with specific value.\nE.g. `||example.org^$inline-script` is converting into:\n```adblock\n||example.org^$csp=script-src 'self' 'unsafe-eval' http: https: data: blob: mediastream: filesystem:\n```",
|
|
6721
6721
|
docs:"https://adguard.app/kb/general/ad-filtering/create-own-filters/#inline-script-modifier" },
|
|
6722
6722
|
adg_ext_any:{ name:"inline-script",
|
|
@@ -6726,7 +6726,7 @@ var data$x = { adg_os_any:{ name:"inline-script",
|
|
|
6726
6726
|
description:"The `$inline-script` modifier is a sort of a shortcut for $csp modifier with specific value.\nE.g. `||example.org^$inline-script` is converting into:\n```adblock\n||example.org^$csp=script-src 'self' 'unsafe-eval' http: https: data: blob: mediastream: filesystem:\n```",
|
|
6727
6727
|
docs:"https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#inline-script" } };
|
|
6728
6728
|
|
|
6729
|
-
var data$
|
|
6729
|
+
var data$x = { adg_os_any:{ name:"jsinject",
|
|
6730
6730
|
description:"Forbids adding of javascript code to the page.",
|
|
6731
6731
|
docs:"https://adguard.app/kb/general/ad-filtering/create-own-filters/#jsinject-modifier",
|
|
6732
6732
|
conflicts:[ "domain",
|
|
@@ -6785,7 +6785,7 @@ var data$w = { adg_os_any:{ name:"jsinject",
|
|
|
6785
6785
|
negatable:false,
|
|
6786
6786
|
exception_only:true } };
|
|
6787
6787
|
|
|
6788
|
-
var data$
|
|
6788
|
+
var data$w = { adg_os_any:{ name:"jsonprune",
|
|
6789
6789
|
description:"The `$jsonprune` rules modify the response to a matching request\nby removing JSON items that match a modified JSONPath expression.\nThey do not modify responses which are not valid JSON documents.",
|
|
6790
6790
|
docs:"https://adguard.app/kb/general/ad-filtering/create-own-filters/#jsonprune-modifier",
|
|
6791
6791
|
assignable:true,
|
|
@@ -6793,7 +6793,7 @@ var data$v = { adg_os_any:{ name:"jsonprune",
|
|
|
6793
6793
|
value_optional:true,
|
|
6794
6794
|
value_format:"(?xi)\n ^\n # the expression always starts with a dollar sign (for root)\n # which should be escaped\n \\\\\n \\$\n \\.?\n # TODO: improve the expression to invalidate unescaped `$` and `,`\n .+\n $" } };
|
|
6795
6795
|
|
|
6796
|
-
var data$
|
|
6796
|
+
var data$v = { adg_any:{ name:"match-case",
|
|
6797
6797
|
description:"This modifier defines a rule which applies only to addresses that match the case.\nDefault rules are case-insensitive.",
|
|
6798
6798
|
docs:"https://adguard.app/kb/general/ad-filtering/create-own-filters/#match-case-modifier" },
|
|
6799
6799
|
abp_any:{ name:"match-case",
|
|
@@ -6803,7 +6803,7 @@ var data$u = { adg_any:{ name:"match-case",
|
|
|
6803
6803
|
description:"This modifier defines a rule which applies only to addresses that match the case.\nDefault rules are case-insensitive.",
|
|
6804
6804
|
docs:"https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#match-case" } };
|
|
6805
6805
|
|
|
6806
|
-
var data$
|
|
6806
|
+
var data$u = { adg_any:{ name:"media",
|
|
6807
6807
|
description:"A restriction of third-party and own requests.\nA third-party request is a request from a different domain.\nFor example, a request to `example.org` from `domain.com` is a third-party request.",
|
|
6808
6808
|
docs:"https://adguard.app/kb/general/ad-filtering/create-own-filters/#media-modifier" },
|
|
6809
6809
|
abp_any:{ name:"media",
|
|
@@ -6813,7 +6813,7 @@ var data$t = { adg_any:{ name:"media",
|
|
|
6813
6813
|
description:"A restriction of third-party and own requests.\nA third-party request is a request from a different domain.\nFor example, a request to `example.org` from `domain.com` is a third-party request.",
|
|
6814
6814
|
docs:"https://help.adblockplus.org/hc/en-us/articles/360062733293#options" } };
|
|
6815
6815
|
|
|
6816
|
-
var data$
|
|
6816
|
+
var data$t = { adg_os_any:{ name:"method",
|
|
6817
6817
|
description:"This modifier limits the rule scope to requests that use the specified set of HTTP methods.\nNegated methods are allowed.",
|
|
6818
6818
|
docs:"https://adguard.app/kb/general/ad-filtering/create-own-filters/#method-modifier",
|
|
6819
6819
|
negatable:false,
|
|
@@ -6832,7 +6832,7 @@ var data$s = { adg_os_any:{ name:"method",
|
|
|
6832
6832
|
assignable:true,
|
|
6833
6833
|
value_format:"pipe_separated_methods" } };
|
|
6834
6834
|
|
|
6835
|
-
var data$
|
|
6835
|
+
var data$s = { adg_os_any:{ name:"mp4",
|
|
6836
6836
|
description:"As a response to blocked request AdGuard returns a short video placeholder.\nRules with `$mp4` are still supported and being converted into `$redirect=noopmp4-1s` now\nbut the support shall be removed in the future.",
|
|
6837
6837
|
docs:"https://adguard.app/kb/general/ad-filtering/create-own-filters/#mp4-modifier",
|
|
6838
6838
|
deprecated:true,
|
|
@@ -6849,7 +6849,7 @@ var data$r = { adg_os_any:{ name:"mp4",
|
|
|
6849
6849
|
docs:"https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#mp4",
|
|
6850
6850
|
negatable:false } };
|
|
6851
6851
|
|
|
6852
|
-
var data$
|
|
6852
|
+
var data$r = { adg_os_any:{ name:"network",
|
|
6853
6853
|
description:"This is basically a Firewall-kind of rules allowing to fully block\nor unblock access to a specified remote address.",
|
|
6854
6854
|
docs:"https://adguard.app/kb/general/ad-filtering/create-own-filters/#network-modifier",
|
|
6855
6855
|
conflicts:[ "app",
|
|
@@ -6857,7 +6857,7 @@ var data$q = { adg_os_any:{ name:"network",
|
|
|
6857
6857
|
inverse_conflicts:true,
|
|
6858
6858
|
negatable:false } };
|
|
6859
6859
|
|
|
6860
|
-
var data$
|
|
6860
|
+
var data$q = { adg_os_any:{ name:"_",
|
|
6861
6861
|
docs:"https://adguard.app/kb/general/ad-filtering/create-own-filters/#noop-modifier",
|
|
6862
6862
|
description:"The noop modifier does nothing and can be used solely to increase rules' readability.\nIt consists of a sequence of underscore characters (_) of any length\nand can appear in a rule as many times as needed.",
|
|
6863
6863
|
negatable:false },
|
|
@@ -6878,13 +6878,13 @@ var data$p = { adg_os_any:{ name:"_",
|
|
|
6878
6878
|
description:"The noop modifier does nothing and can be used solely to increase rules' readability.\nIt consists of a sequence of underscore characters (_) of any length\nand can appear in a rule as many times as needed.",
|
|
6879
6879
|
negatable:false } };
|
|
6880
6880
|
|
|
6881
|
-
var data$
|
|
6881
|
+
var data$p = { adg_any:{ name:"object-subrequest",
|
|
6882
6882
|
description:"The `$object-subrequest` modifier is removed and is no longer supported.\nRules with it are considered as invalid.\nThe rule corresponds to requests by browser plugins (it is usually Flash).",
|
|
6883
6883
|
docs:"https://adguard.app/kb/general/ad-filtering/create-own-filters/#object-subrequest-modifier",
|
|
6884
6884
|
removed:true,
|
|
6885
6885
|
removal_message:"The `$object-subrequest` modifier is removed and is no longer supported.\nRules with it are considered as invalid." } };
|
|
6886
6886
|
|
|
6887
|
-
var data$
|
|
6887
|
+
var data$o = { adg_any:{ name:"object",
|
|
6888
6888
|
description:"The rule corresponds to browser plugins resources, e.g. Java or Flash",
|
|
6889
6889
|
docs:"https://adguard.app/kb/general/ad-filtering/create-own-filters/#object-modifier" },
|
|
6890
6890
|
abp_any:{ name:"object",
|
|
@@ -6894,7 +6894,7 @@ var data$n = { adg_any:{ name:"object",
|
|
|
6894
6894
|
description:"The rule corresponds to browser plugins resources, e.g. Java or Flash.",
|
|
6895
6895
|
docs:"https://help.adblockplus.org/hc/en-us/articles/360062733293-How-to-write-filters#type-options" } };
|
|
6896
6896
|
|
|
6897
|
-
var data$
|
|
6897
|
+
var data$n = { adg_any:{ name:"other",
|
|
6898
6898
|
description:"The rule applies to requests for which the type has not been determined\nor does not match the types listed above.",
|
|
6899
6899
|
docs:"https://adguard.app/kb/general/ad-filtering/create-own-filters/#other-modifier" },
|
|
6900
6900
|
abp_any:{ name:"other",
|
|
@@ -6904,7 +6904,7 @@ var data$m = { adg_any:{ name:"other",
|
|
|
6904
6904
|
description:"The rule applies to requests for which the type has not been determined\nor does not match the types listed above.",
|
|
6905
6905
|
docs:"https://help.adblockplus.org/hc/en-us/articles/360062733293-How-to-write-filters#type-options" } };
|
|
6906
6906
|
|
|
6907
|
-
var data$
|
|
6907
|
+
var data$m = { adg_os_any:{ name:"permissions",
|
|
6908
6908
|
description:"For the requests matching a `$permissions` rule, ad blocker strengthens response's feature policy\nby adding additional feature policy equal to the `$permissions` modifier contents.\n`$permissions` rules are applied independently from any other rule type.",
|
|
6909
6909
|
docs:"https://adguard.app/kb/general/ad-filtering/create-own-filters/#permissions-modifier",
|
|
6910
6910
|
version_added:"CoreLibs 1.11",
|
|
@@ -6917,7 +6917,7 @@ var data$l = { adg_os_any:{ name:"permissions",
|
|
|
6917
6917
|
value_optional:true,
|
|
6918
6918
|
value_format:"permissions_value" } };
|
|
6919
6919
|
|
|
6920
|
-
var data$
|
|
6920
|
+
var data$l = { adg_any:{ name:"ping",
|
|
6921
6921
|
description:"The rule corresponds to requests caused by either navigator.sendBeacon() or the ping attribute on links.",
|
|
6922
6922
|
docs:"https://adguard.app/kb/general/ad-filtering/create-own-filters/#ping-modifier" },
|
|
6923
6923
|
abp_any:{ name:"ping",
|
|
@@ -6927,13 +6927,13 @@ var data$k = { adg_any:{ name:"ping",
|
|
|
6927
6927
|
description:"The rule corresponds to requests caused by either navigator.sendBeacon() or the ping attribute on links.",
|
|
6928
6928
|
docs:"https://help.adblockplus.org/hc/en-us/articles/360062733293-How-to-write-filters#type-options" } };
|
|
6929
6929
|
|
|
6930
|
-
var data$
|
|
6930
|
+
var data$k = { ubo_ext_any:{ name:"popunder",
|
|
6931
6931
|
description:"To block \"popunders\" windows/tabs where the original page redirects to an advertisement\nand the desired content loads in the newly created one.\nTo be used in the same manner as the popup filter option, except that it will block popunders.",
|
|
6932
6932
|
docs:"https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#popunder",
|
|
6933
6933
|
negatable:false,
|
|
6934
6934
|
block_only:true } };
|
|
6935
6935
|
|
|
6936
|
-
var data$
|
|
6936
|
+
var data$j = { adg_any:{ name:"popup",
|
|
6937
6937
|
description:"Pages opened in a new tab or window.\nNote: Filters will not block pop-ups by default, only if the `$popup` type option is specified.",
|
|
6938
6938
|
docs:"https://adguard.app/kb/general/ad-filtering/create-own-filters/#popup-modifier",
|
|
6939
6939
|
negatable:false },
|
|
@@ -6946,7 +6946,7 @@ var data$i = { adg_any:{ name:"popup",
|
|
|
6946
6946
|
docs:"https://help.adblockplus.org/hc/en-us/articles/360062733293-How-to-write-filters#type-options",
|
|
6947
6947
|
negatable:false } };
|
|
6948
6948
|
|
|
6949
|
-
var data$
|
|
6949
|
+
var data$i = { adg_os_any:{ name:"redirect-rule",
|
|
6950
6950
|
description:"This is basically an alias to `$redirect`\nsince it has the same \"redirection\" values and the logic is almost similar.\nThe difference is that `$redirect-rule` is applied only in the case\nwhen the target request is blocked by a different basic rule.",
|
|
6951
6951
|
docs:"https://adguard.app/kb/general/ad-filtering/create-own-filters/#redirect-rule-modifier",
|
|
6952
6952
|
conflicts:[ "domain",
|
|
@@ -7037,7 +7037,7 @@ var data$h = { adg_os_any:{ name:"redirect-rule",
|
|
|
7037
7037
|
negatable:false,
|
|
7038
7038
|
value_format:"(?x)\n ^(\n 1x1\\.gif|\n 2x2\\.png|\n 3x2\\.png|\n 32x32\\.png|\n noop\\.css|\n noop\\.html|\n noopframe|\n noop\\.js|\n noop\\.txt|\n noop-0\\.1s\\.mp3|\n noop-0\\.5s\\.mp3|\n noop-1s\\.mp4|\n none|\n click2load\\.html|\n addthis_widget\\.js|\n amazon_ads\\.js|\n amazon_apstag\\.js|\n monkeybroker\\.js|\n doubleclick_instream_ad_status|\n google-analytics_ga\\.js|\n google-analytics_analytics\\.js|\n google-analytics_inpage_linkid\\.js|\n google-analytics_cx_api\\.js|\n google-ima\\.js|\n googletagservices_gpt\\.js|\n googletagmanager_gtm\\.js|\n googlesyndication_adsbygoogle\\.js|\n scorecardresearch_beacon\\.js|\n outbrain-widget\\.js|\n hd-main\\.js\n )\n (:[0-9]+)?$" } };
|
|
7039
7039
|
|
|
7040
|
-
var data$
|
|
7040
|
+
var data$h = { adg_os_any:{ name:"redirect",
|
|
7041
7041
|
description:"Used to redirect web requests to a local \"resource\".",
|
|
7042
7042
|
docs:"https://adguard.app/kb/general/ad-filtering/create-own-filters/#redirect-modifier",
|
|
7043
7043
|
assignable:true,
|
|
@@ -7065,6 +7065,17 @@ var data$g = { adg_os_any:{ name:"redirect",
|
|
|
7065
7065
|
negatable:false,
|
|
7066
7066
|
value_format:"(?x)\n # ABP resources always starts with the `abp-resource:` prefix\n ^abp-resource:\n # Possible resource names\n (\n blank-text|\n blank-css|\n blank-js|\n blank-html|\n blank-mp3|\n 1x1-transparent-gif|\n 2x2-transparent-png|\n 3x2-transparent-png|\n 32x32-transparent-png\n )$" } };
|
|
7067
7067
|
|
|
7068
|
+
var data$g = { adg_os_any:{ name:"referrerpolicy",
|
|
7069
|
+
description:"This modifier allows overriding of a page's referrer policy.",
|
|
7070
|
+
docs:"https://adguard.app/kb/general/ad-filtering/create-own-filters/#referrerpolicy-modifier",
|
|
7071
|
+
conflicts:[ "document",
|
|
7072
|
+
"subdocument" ],
|
|
7073
|
+
inverse_conflicts:true,
|
|
7074
|
+
assignable:true,
|
|
7075
|
+
negatable:false,
|
|
7076
|
+
value_optional:true,
|
|
7077
|
+
value_format:"referrerpolicy_value" } };
|
|
7078
|
+
|
|
7068
7079
|
var data$f = { adg_os_any:{ name:"removeheader",
|
|
7069
7080
|
description:"Rules with the `$removeheader` modifier are intended to remove headers from HTTP requests and responses.",
|
|
7070
7081
|
docs:"https://adguard.app/kb/general/ad-filtering/create-own-filters/#removeheader-modifier",
|
|
@@ -7374,46 +7385,47 @@ var data = { adg_any:{ name:"xmlhttprequest",
|
|
|
7374
7385
|
// @ts-nocheck
|
|
7375
7386
|
// Please keep imports and exports in alphabetical order
|
|
7376
7387
|
const rawModifiersData = {
|
|
7377
|
-
all: data$
|
|
7378
|
-
app: data$
|
|
7379
|
-
badfilter: data$
|
|
7380
|
-
cname: data$
|
|
7381
|
-
content: data$
|
|
7382
|
-
cookie: data$
|
|
7383
|
-
csp: data$
|
|
7384
|
-
denyallow: data$
|
|
7385
|
-
document: data$
|
|
7386
|
-
domain: data$
|
|
7387
|
-
elemhide: data$
|
|
7388
|
-
empty: data$
|
|
7389
|
-
firstParty: data$
|
|
7390
|
-
extension: data$
|
|
7391
|
-
font: data$
|
|
7392
|
-
genericblock: data$
|
|
7393
|
-
generichide: data$
|
|
7394
|
-
header: data$
|
|
7395
|
-
hls: data$
|
|
7396
|
-
image: data$
|
|
7397
|
-
important: data$
|
|
7398
|
-
inlineFont: data$
|
|
7399
|
-
inlineScript: data$
|
|
7400
|
-
jsinject: data$
|
|
7401
|
-
jsonprune: data$
|
|
7402
|
-
matchCase: data$
|
|
7403
|
-
media: data$
|
|
7404
|
-
method: data$
|
|
7405
|
-
mp4: data$
|
|
7406
|
-
network: data$
|
|
7407
|
-
noop: data$
|
|
7408
|
-
objectSubrequest: data$
|
|
7409
|
-
object: data$
|
|
7410
|
-
other: data$
|
|
7411
|
-
permissions: data$
|
|
7412
|
-
ping: data$
|
|
7413
|
-
popunder: data$
|
|
7414
|
-
popup: data$
|
|
7415
|
-
redirectRule: data$
|
|
7416
|
-
redirect: data$
|
|
7388
|
+
all: data$U,
|
|
7389
|
+
app: data$T,
|
|
7390
|
+
badfilter: data$S,
|
|
7391
|
+
cname: data$R,
|
|
7392
|
+
content: data$Q,
|
|
7393
|
+
cookie: data$P,
|
|
7394
|
+
csp: data$O,
|
|
7395
|
+
denyallow: data$N,
|
|
7396
|
+
document: data$M,
|
|
7397
|
+
domain: data$L,
|
|
7398
|
+
elemhide: data$K,
|
|
7399
|
+
empty: data$J,
|
|
7400
|
+
firstParty: data$I,
|
|
7401
|
+
extension: data$H,
|
|
7402
|
+
font: data$G,
|
|
7403
|
+
genericblock: data$F,
|
|
7404
|
+
generichide: data$E,
|
|
7405
|
+
header: data$D,
|
|
7406
|
+
hls: data$C,
|
|
7407
|
+
image: data$B,
|
|
7408
|
+
important: data$A,
|
|
7409
|
+
inlineFont: data$z,
|
|
7410
|
+
inlineScript: data$y,
|
|
7411
|
+
jsinject: data$x,
|
|
7412
|
+
jsonprune: data$w,
|
|
7413
|
+
matchCase: data$v,
|
|
7414
|
+
media: data$u,
|
|
7415
|
+
method: data$t,
|
|
7416
|
+
mp4: data$s,
|
|
7417
|
+
network: data$r,
|
|
7418
|
+
noop: data$q,
|
|
7419
|
+
objectSubrequest: data$p,
|
|
7420
|
+
object: data$o,
|
|
7421
|
+
other: data$n,
|
|
7422
|
+
permissions: data$m,
|
|
7423
|
+
ping: data$l,
|
|
7424
|
+
popunder: data$k,
|
|
7425
|
+
popup: data$j,
|
|
7426
|
+
redirectRule: data$i,
|
|
7427
|
+
redirect: data$h,
|
|
7428
|
+
referrerpolicy: data$g,
|
|
7417
7429
|
removeheader: data$f,
|
|
7418
7430
|
removeparam: data$e,
|
|
7419
7431
|
replace: data$d,
|
|
@@ -7606,7 +7618,7 @@ const ALLOWED_CSP_DIRECTIVES = new Set([
|
|
|
7606
7618
|
'worker-src',
|
|
7607
7619
|
]);
|
|
7608
7620
|
/**
|
|
7609
|
-
* Allowed
|
|
7621
|
+
* Allowed directives for $permissions modifier.
|
|
7610
7622
|
*
|
|
7611
7623
|
* @see {@link https://adguard.app/kb/general/ad-filtering/create-own-filters/#permissions-modifier}
|
|
7612
7624
|
*/
|
|
@@ -7656,6 +7668,21 @@ const PERMISSIONS_TOKEN_SELF = 'self';
|
|
|
7656
7668
|
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Permissions_Policy#allowlists}
|
|
7657
7669
|
*/
|
|
7658
7670
|
const EMPTY_PERMISSIONS_ALLOWLIST = `${OPEN_PARENTHESIS}${CLOSE_PARENTHESIS}`;
|
|
7671
|
+
/**
|
|
7672
|
+
* Allowed directives for $referrerpolicy modifier.
|
|
7673
|
+
*
|
|
7674
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy}
|
|
7675
|
+
*/
|
|
7676
|
+
const REFERRER_POLICY_DIRECTIVES = new Set([
|
|
7677
|
+
'no-referrer',
|
|
7678
|
+
'no-referrer-when-downgrade',
|
|
7679
|
+
'origin',
|
|
7680
|
+
'origin-when-cross-origin',
|
|
7681
|
+
'same-origin',
|
|
7682
|
+
'strict-origin',
|
|
7683
|
+
'strict-origin-when-cross-origin',
|
|
7684
|
+
'unsafe-url',
|
|
7685
|
+
]);
|
|
7659
7686
|
/**
|
|
7660
7687
|
* Prefixes for error messages used in modifier validation.
|
|
7661
7688
|
*/
|
|
@@ -7668,6 +7695,7 @@ const VALIDATION_ERROR_PREFIX = {
|
|
|
7668
7695
|
INVALID_PERMISSION_DIRECTIVE: 'Invalid Permissions-Policy directive for the modifier',
|
|
7669
7696
|
INVALID_PERMISSION_ORIGINS: 'Origins in the value is invalid for the modifier and the directive',
|
|
7670
7697
|
INVALID_PERMISSION_ORIGIN_QUOTES: 'Double quotes should be used for origins in the value of the modifier',
|
|
7698
|
+
INVALID_REFERRER_POLICY_DIRECTIVE: 'Invalid Referrer-Policy directive for the modifier',
|
|
7671
7699
|
MIXED_NEGATIONS: 'Simultaneous usage of negated and not negated values is forbidden for the modifier',
|
|
7672
7700
|
NO_CSP_VALUE: 'No CSP value for the modifier and the directive',
|
|
7673
7701
|
NO_CSP_DIRECTIVE_QUOTE: 'CSP directives should no be quoted for the modifier',
|
|
@@ -7991,6 +8019,7 @@ var CustomValueFormatValidatorName;
|
|
|
7991
8019
|
CustomValueFormatValidatorName["Domain"] = "pipe_separated_domains";
|
|
7992
8020
|
CustomValueFormatValidatorName["Method"] = "pipe_separated_methods";
|
|
7993
8021
|
CustomValueFormatValidatorName["Permissions"] = "permissions_value";
|
|
8022
|
+
CustomValueFormatValidatorName["ReferrerPolicy"] = "referrerpolicy_value";
|
|
7994
8023
|
CustomValueFormatValidatorName["StealthOption"] = "pipe_separated_stealth_options";
|
|
7995
8024
|
})(CustomValueFormatValidatorName || (CustomValueFormatValidatorName = {}));
|
|
7996
8025
|
/**
|
|
@@ -8447,6 +8476,26 @@ const validatePermissions = (modifier) => {
|
|
|
8447
8476
|
}
|
|
8448
8477
|
return { valid: true };
|
|
8449
8478
|
};
|
|
8479
|
+
/**
|
|
8480
|
+
* Validates `referrerpolicy_value` custom value format.
|
|
8481
|
+
* Used for $referrerpolicy modifier.
|
|
8482
|
+
*
|
|
8483
|
+
* @param modifier Modifier AST node.
|
|
8484
|
+
*
|
|
8485
|
+
* @returns Validation result.
|
|
8486
|
+
*/
|
|
8487
|
+
const validateReferrerPolicy = (modifier) => {
|
|
8488
|
+
if (!modifier.value?.value) {
|
|
8489
|
+
return getValueRequiredValidationResult(modifier.modifier.value);
|
|
8490
|
+
}
|
|
8491
|
+
const modifierName = modifier.modifier.value;
|
|
8492
|
+
const modifierValue = modifier.value.value;
|
|
8493
|
+
if (!REFERRER_POLICY_DIRECTIVES.has(modifierValue)) {
|
|
8494
|
+
// eslint-disable-next-line max-len
|
|
8495
|
+
return getInvalidValidationResult(`${VALIDATION_ERROR_PREFIX.INVALID_REFERRER_POLICY_DIRECTIVE}: '${modifierName}': '${modifierValue}'`);
|
|
8496
|
+
}
|
|
8497
|
+
return { valid: true };
|
|
8498
|
+
};
|
|
8450
8499
|
/**
|
|
8451
8500
|
* Map of all available pre-defined validators for modifiers with custom `value_format`.
|
|
8452
8501
|
*/
|
|
@@ -8457,6 +8506,7 @@ const CUSTOM_VALUE_FORMAT_MAP = {
|
|
|
8457
8506
|
[CustomValueFormatValidatorName.Domain]: validatePipeSeparatedDomains,
|
|
8458
8507
|
[CustomValueFormatValidatorName.Method]: validatePipeSeparatedMethods,
|
|
8459
8508
|
[CustomValueFormatValidatorName.Permissions]: validatePermissions,
|
|
8509
|
+
[CustomValueFormatValidatorName.ReferrerPolicy]: validateReferrerPolicy,
|
|
8460
8510
|
[CustomValueFormatValidatorName.StealthOption]: validatePipeSeparatedStealthOptions,
|
|
8461
8511
|
};
|
|
8462
8512
|
/**
|
|
@@ -10535,7 +10585,7 @@ class LogicalExpressionUtils {
|
|
|
10535
10585
|
}
|
|
10536
10586
|
}
|
|
10537
10587
|
|
|
10538
|
-
const version$1 = "1.1.
|
|
10588
|
+
const version$1 = "1.1.7";
|
|
10539
10589
|
|
|
10540
10590
|
/**
|
|
10541
10591
|
* @file AGTree version
|
package/dist/agtree.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* AGTree v1.1.
|
|
2
|
+
* AGTree v1.1.7 (build date: Tue, 07 Nov 2023 14:17:46 GMT)
|
|
3
3
|
* (c) 2023 AdGuard Software Ltd.
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
|