@adguard/agtree 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,13 +2,15 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
- The format is based on [Keep a Changelog][keepachangelog], and this project
6
- adheres to [Semantic Versioning][semver].
5
+ The format is based on [Keep a Changelog][keepachangelog], and this project adheres to [Semantic Versioning][semver].
7
6
 
8
- [keepachangelog]: https://keepachangelog.com/en/1.0.0/
9
- [semver]: https://semver.org/spec/v2.0.0.html
7
+ ## 1.1.1 - 2023-08-11
8
+
9
+ ### Fixed
10
10
 
11
- ## [1.1.0] - 2023-08-10
11
+ - Validation of assignable modifiers which may be used without a value
12
+
13
+ ## 1.1.0 - 2023-08-10
12
14
 
13
15
  ### Added
14
16
 
@@ -34,8 +36,11 @@ adheres to [Semantic Versioning][semver].
34
36
  - Scriptlet parsing
35
37
  - Metadata parsing
36
38
 
37
- ## [1.0.1] - 2023-05-24
39
+ ## 1.0.1 - 2023-05-24
38
40
 
39
41
  ### Added
40
42
 
41
43
  - Migrated parser from AGLint to a separate package.
44
+
45
+ [keepachangelog]: https://keepachangelog.com/en/1.0.0/
46
+ [semver]: https://semver.org/spec/v2.0.0.html
package/README.md CHANGED
@@ -1,56 +1,34 @@
1
1
  <!-- markdownlint-disable -->
2
-
3
2
  &nbsp;
4
-
5
3
  <p align="center">
6
4
  <picture>
7
- <source
8
- media="(prefers-color-scheme: dark)"
9
- srcset="https://cdn.adtidy.org/website/github.com/AGTree/agtree_darkmode.svg"
10
- />
11
- <img
12
- alt="AGTree"
13
- src="https://cdn.adtidy.org/website/github.com/AGTree/agtree_lightmode.svg"
14
- width="350px"
15
- />
5
+ <source media="(prefers-color-scheme: dark)" srcset="https://cdn.adtidy.org/website/github.com/AGTree/agtree_darkmode.svg" />
6
+ <img alt="AGTree" src="https://cdn.adtidy.org/website/github.com/AGTree/agtree_lightmode.svg" width="350px" />
16
7
  </picture>
17
8
  </p>
18
9
  <h3 align="center">Universal adblock filter list parser</h3>
19
10
  <p align="center">Supported syntaxes:</p>
20
11
  <p align="center">
21
12
  <a href="https://adguard.com">
22
- <img
23
- src="https://cdn.adguard.com/website/github.com/AGLint/adg_logo.svg"
24
- width="14px"
25
- />
13
+ <img src="https://cdn.adguard.com/website/github.com/AGLint/adg_logo.svg" width="14px" />
26
14
  AdGuard
27
15
  </a>
28
16
  |
29
17
  <a href="https://github.com/gorhill/uBlock">
30
- <img
31
- src="https://cdn.adguard.com/website/github.com/AGLint/ubo_logo.svg"
32
- width="14px"
33
- />
18
+ <img src="https://cdn.adguard.com/website/github.com/AGLint/ubo_logo.svg" width="14px" />
34
19
  uBlock Origin
35
20
  </a>
36
21
  |
37
22
  <a href="https://getadblock.com">
38
- <img
39
- src="https://cdn.adguard.com/website/github.com/AGLint/ab_logo.svg"
40
- width="14px"
41
- />
23
+ <img src="https://cdn.adguard.com/website/github.com/AGLint/ab_logo.svg" width="14px" />
42
24
  AdBlock
43
25
  </a>
44
26
  |
45
27
  <a href="https://adblockplus.org">
46
- <img
47
- src="https://cdn.adguard.com/website/github.com/AGLint/abp_logo.svg"
48
- width="14px"
49
- />
28
+ <img src="https://cdn.adguard.com/website/github.com/AGLint/abp_logo.svg" width="14px" />
50
29
  Adblock Plus
51
30
  </a>
52
31
  </p>
53
-
54
32
  <p align="center">
55
33
  <a href="https://www.npmjs.com/package/@adguard/agtree">
56
34
  <img src="https://img.shields.io/npm/v/@adguard/agtree" alt="NPM version" />
@@ -74,8 +52,7 @@ Table of Contents:
74
52
 
75
53
  ## Introduction
76
54
 
77
- AGTree is a universal tool for working with adblock filter lists. It contains
78
- the following modules:
55
+ AGTree is a universal tool for working with adblock filter lists. It contains the following modules:
79
56
 
80
57
  - [Adblock rule converter][converter-url]
81
58
  - [Adblock rule parser][parser-url]
@@ -88,41 +65,23 @@ AGTree supports all syntaxes currently in use:
88
65
  - <img src="https://cdn.adguard.com/website/github.com/AGLint/abp_logo.svg" width="14px"> [Adblock Plus][abp-url]
89
66
  - <img src="https://cdn.adguard.com/website/github.com/AGLint/ab_logo.svg" width="14px"> [AdBlock][ab-url]
90
67
 
91
- [ab-url]: https://getadblock.com
92
- [abp-url]: https://adblockplus.org
93
- [adg-url]: https://adguard.com
94
- [compatibility-tables-url]: https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree/src/compatibility-tables
95
- [converter-url]: https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree/src/converter
96
- [parser-url]: https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree/src/parser
97
- [ubo-url]: https://github.com/gorhill/uBlock
98
-
99
68
  ## Development & Contribution
100
69
 
101
- Please read the [CONTRIBUTING.md][contributing-url] file for details on how to
102
- contribute to this project.
103
-
104
- [contributing-url]: https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree/CONTRIBUTING.md
70
+ Please read the [CONTRIBUTING.md][contributing-url] file for details on how to contribute to this project.
105
71
 
106
72
  ## Ideas & Questions
107
73
 
108
- If you have any questions or ideas for new features, please
109
- [open an issue][new-issue-url] or a [discussion][discussions-url]. We will be
110
- happy to discuss it with you.
111
-
112
- [discussions-url]: https://github.com/AdguardTeam/tsurlfilter/discussions
113
- [new-issue-url]: https://github.com/AdguardTeam/tsurlfilter/issues/new
74
+ If you have any questions or ideas for new features, please [open an issue][new-issue-url] or a
75
+ [discussion][discussions-url]. We will be happy to discuss it with you.
114
76
 
115
77
  ## License
116
78
 
117
- AGTree is licensed under the MIT License. See the [LICENSE][license-url] file
118
- for details.
119
-
120
- [license-url]: https://github.com/AdguardTeam/tsurlfilter/blob/master/packages/agtree/LICENSE
79
+ AGTree is licensed under the MIT License. See the [LICENSE][license-url] file for details.
121
80
 
122
81
  ## References
123
82
 
124
- Here are some useful links to help you write adblock rules. This list is not
125
- exhaustive, so if you know any other useful resources, please let us know.
83
+ Here are some useful links to help you write adblock rules. This list is not exhaustive, so if you know any other useful
84
+ resources, please let us know.
126
85
 
127
86
  <!--markdownlint-disable MD013-->
128
87
  - Syntax documentation:
@@ -143,15 +102,26 @@ exhaustive, so if you know any other useful resources, please let us know.
143
102
  - <img src="https://cdn.adguard.com/website/github.com/AGLint/adg_logo.svg" width="14px"> [AdGuard's compatibility table][adg-compatibility-table]
144
103
  <!--markdownlint-enable MD013-->
145
104
 
105
+ [ab-url]: https://getadblock.com
146
106
  [abp-ext-css]: https://help.eyeo.com/adblockplus/how-to-write-filters#elemhide-emulation
147
107
  [abp-filters]: https://help.eyeo.com/adblockplus/how-to-write-filters
148
108
  [abp-snippets]: https://help.eyeo.com/adblockplus/snippet-filters-tutorial#snippets-ref
109
+ [abp-url]: https://adblockplus.org
149
110
  [adg-compatibility-table]: https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/compatibility-table.md
150
111
  [adg-ext-css]: https://github.com/AdguardTeam/ExtendedCss/blob/master/README.md
151
112
  [adg-filters]: https://kb.adguard.com/en/general/how-to-create-your-own-ad-filters
152
113
  [adg-scriptlets]: https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#scriptlets
114
+ [adg-url]: https://adguard.com
115
+ [compatibility-tables-url]: https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree/src/compatibility-tables
116
+ [contributing-url]: https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree/CONTRIBUTING.md
117
+ [converter-url]: https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree/src/converter
153
118
  [css-tree-docs]: https://github.com/csstree/csstree/tree/master/docs
119
+ [discussions-url]: https://github.com/AdguardTeam/tsurlfilter/discussions
120
+ [license-url]: https://github.com/AdguardTeam/tsurlfilter/blob/master/packages/agtree/LICENSE
154
121
  [mdn-css-selectors]: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors
122
+ [new-issue-url]: https://github.com/AdguardTeam/tsurlfilter/issues/new
123
+ [parser-url]: https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree/src/parser
155
124
  [ubo-filters]: https://github.com/gorhill/uBlock/wiki/Static-filter-syntax
156
125
  [ubo-procedural]: https://github.com/gorhill/uBlock/wiki/Procedural-cosmetic-filters
157
126
  [ubo-scriptlets]: https://github.com/gorhill/uBlock/wiki/Resources-Library#available-general-purpose-scriptlets
127
+ [ubo-url]: https://github.com/gorhill/uBlock
package/dist/agtree.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- * AGTree v1.1.0 (build date: Thu, 10 Aug 2023 15:16:26 GMT)
2
+ * AGTree v1.1.1 (build date: Fri, 11 Aug 2023 13:11:01 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
@@ -5837,12 +5837,14 @@ var data$O = { adg_os_any:{ name:"cookie",
5837
5837
  docs:"https://adguard.app/kb/general/ad-filtering/create-own-filters/#cookie-modifier",
5838
5838
  assignable:true,
5839
5839
  negatable:false,
5840
+ value_optional:true,
5840
5841
  value_format:"^([^;=\\s]*?)((?:;(maxAge=\\d+;?)?|(sameSite=(lax|none|strict);?)?){1,3})(?<!;)$" },
5841
5842
  adg_ext_any:{ name:"cookie",
5842
5843
  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.",
5843
5844
  docs:"https://adguard.app/kb/general/ad-filtering/create-own-filters/#cookie-modifier",
5844
5845
  assignable:true,
5845
5846
  negatable:false,
5847
+ value_optional:true,
5846
5848
  value_format:"^([^;=\\s]*?)((?:;(maxAge=\\d+;?)?|(sameSite=(lax|none|strict);?)?){1,3})(?<!;)$" } };
5847
5849
 
5848
5850
  var data$N = { adg_os_any:{ name:"csp",
@@ -5855,6 +5857,7 @@ var data$N = { adg_os_any:{ name:"csp",
5855
5857
  inverse_conflicts:true,
5856
5858
  assignable:true,
5857
5859
  negatable:false,
5860
+ value_optional:true,
5858
5861
  value_format:"/[^,$]+/" },
5859
5862
  adg_ext_any:{ name:"csp",
5860
5863
  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.",
@@ -5866,6 +5869,7 @@ var data$N = { adg_os_any:{ name:"csp",
5866
5869
  inverse_conflicts:true,
5867
5870
  assignable:true,
5868
5871
  negatable:false,
5872
+ value_optional:true,
5869
5873
  value_format:"/[^,$]+/" },
5870
5874
  abp_ext_any:{ name:"csp",
5871
5875
  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.",
@@ -5875,6 +5879,7 @@ var data$N = { adg_os_any:{ name:"csp",
5875
5879
  inverse_conflicts:true,
5876
5880
  assignable:true,
5877
5881
  negatable:false,
5882
+ value_optional:true,
5878
5883
  value_format:"/[^,$]+/" },
5879
5884
  ubo_ext_any:{ name:"csp",
5880
5885
  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.",
@@ -5886,6 +5891,7 @@ var data$N = { adg_os_any:{ name:"csp",
5886
5891
  inverse_conflicts:true,
5887
5892
  assignable:true,
5888
5893
  negatable:false,
5894
+ value_optional:true,
5889
5895
  value_format:"/[^,$]+/" } };
5890
5896
 
5891
5897
  var data$M = { adg_os_any:{ name:"denyallow",
@@ -6451,6 +6457,7 @@ var data$h = { adg_os_any:{ name:"redirect-rule",
6451
6457
  inverse_conflicts:true,
6452
6458
  assignable:true,
6453
6459
  negatable:false,
6460
+ value_optional:true,
6454
6461
  value_format:"(?x)\n ^(\n 1x1-transparent\\.gif|\n 2x2-transparent\\.png|\n 3x2-transparent\\.png|\n 32x32-transparent\\.png|\n noopframe|\n noopcss|\n noopjs|\n noopjson|\n nooptext|\n empty|\n noopvmap-1\\.0|\n noopvast-2\\.0|\n noopvast-3\\.0|\n noopvast-4\\.0|\n noopmp3-0\\.1s|\n noopmp4-1s|\n amazon-apstag|\n ati-smarttag|\n didomi-loader|\n fingerprintjs2|\n fingerprintjs3|\n gemius|\n google-analytics-ga|\n google-analytics|\n google-ima3|\n googlesyndication-adsbygoogle|\n googletagservices-gpt|\n matomo|\n metrika-yandex-tag|\n metrika-yandex-watch|\n naver-wcslog|\n noeval|\n pardot-1\\.0|\n prebid-ads|\n prebid|\n prevent-bab|\n prevent-bab2|\n prevent-fab-3\\.2\\.0|\n prevent-popads-net|\n scorecardresearch-beacon|\n set-popads-dummy|\n click2load\\.html|\n )?$" },
6455
6462
  adg_ext_any:{ name:"redirect-rule",
6456
6463
  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.",
@@ -6480,6 +6487,7 @@ var data$h = { adg_os_any:{ name:"redirect-rule",
6480
6487
  inverse_conflicts:true,
6481
6488
  assignable:true,
6482
6489
  negatable:false,
6490
+ value_optional:true,
6483
6491
  value_format:"(?x)\n ^(\n 1x1-transparent\\.gif|\n 2x2-transparent\\.png|\n 3x2-transparent\\.png|\n 32x32-transparent\\.png|\n noopframe|\n noopcss|\n noopjs|\n noopjson|\n nooptext|\n empty|\n noopvmap-1\\.0|\n noopvast-2\\.0|\n noopvast-3\\.0|\n noopvast-4\\.0|\n noopmp3-0\\.1s|\n noopmp4-1s|\n amazon-apstag|\n ati-smarttag|\n didomi-loader|\n fingerprintjs2|\n fingerprintjs3|\n gemius|\n google-analytics-ga|\n google-analytics|\n google-ima3|\n googlesyndication-adsbygoogle|\n googletagservices-gpt|\n matomo|\n metrika-yandex-tag|\n metrika-yandex-watch|\n naver-wcslog|\n noeval|\n pardot-1\\.0|\n prebid-ads|\n prebid|\n prevent-bab|\n prevent-bab2|\n prevent-fab-3\\.2\\.0|\n prevent-popads-net|\n scorecardresearch-beacon|\n set-popads-dummy|\n click2load\\.html|\n )?$" },
6484
6492
  ubo_ext_any:{ name:"redirect-rule",
6485
6493
  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.",
@@ -6516,18 +6524,21 @@ var data$g = { adg_os_any:{ name:"redirect",
6516
6524
  docs:"https://adguard.app/kb/general/ad-filtering/create-own-filters/#redirect-modifier",
6517
6525
  assignable:true,
6518
6526
  negatable:false,
6527
+ value_optional:true,
6519
6528
  value_format:"(?x)\n ^(\n 1x1-transparent\\.gif|\n 2x2-transparent\\.png|\n 3x2-transparent\\.png|\n 32x32-transparent\\.png|\n noopframe|\n noopcss|\n noopjs|\n noopjson|\n nooptext|\n empty|\n noopvmap-1\\.0|\n noopvast-2\\.0|\n noopvast-3\\.0|\n noopvast-4\\.0|\n noopmp3-0\\.1s|\n noopmp4-1s|\n amazon-apstag|\n ati-smarttag|\n didomi-loader|\n fingerprintjs2|\n fingerprintjs3|\n gemius|\n google-analytics-ga|\n google-analytics|\n google-ima3|\n googlesyndication-adsbygoogle|\n googletagservices-gpt|\n matomo|\n metrika-yandex-tag|\n metrika-yandex-watch|\n naver-wcslog|\n noeval|\n pardot-1\\.0|\n prebid-ads|\n prebid|\n prevent-bab|\n prevent-bab2|\n prevent-fab-3\\.2\\.0|\n prevent-popads-net|\n scorecardresearch-beacon|\n set-popads-dummy|\n click2load\\.html\n )?$" },
6520
6529
  adg_ext_any:{ name:"redirect",
6521
6530
  description:"Used to redirect web requests to a local \"resource\".",
6522
6531
  docs:"https://adguard.app/kb/general/ad-filtering/create-own-filters/#redirect-modifier",
6523
6532
  assignable:true,
6524
6533
  negatable:false,
6534
+ value_optional:true,
6525
6535
  value_format:"(?x)\n ^(\n 1x1-transparent\\.gif|\n 2x2-transparent\\.png|\n 3x2-transparent\\.png|\n 32x32-transparent\\.png|\n noopframe|\n noopcss|\n noopjs|\n noopjson|\n nooptext|\n empty|\n noopvmap-1\\.0|\n noopvast-2\\.0|\n noopvast-3\\.0|\n noopvast-4\\.0|\n noopmp3-0\\.1s|\n noopmp4-1s|\n amazon-apstag|\n ati-smarttag|\n didomi-loader|\n fingerprintjs2|\n fingerprintjs3|\n gemius|\n google-analytics-ga|\n google-analytics|\n google-ima3|\n googlesyndication-adsbygoogle|\n googletagservices-gpt|\n matomo|\n metrika-yandex-tag|\n metrika-yandex-watch|\n naver-wcslog|\n noeval|\n pardot-1\\.0|\n prebid-ads|\n prebid|\n prevent-bab|\n prevent-bab2|\n prevent-fab-3\\.2\\.0|\n prevent-popads-net|\n scorecardresearch-beacon|\n set-popads-dummy|\n click2load\\.html\n )?$" },
6526
6536
  ubo_ext_any:{ name:"redirect",
6527
6537
  description:"Used to redirect web requests to a local \"resource\".",
6528
6538
  docs:"https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#redirect",
6529
6539
  assignable:true,
6530
6540
  negatable:false,
6541
+ value_optional:true,
6531
6542
  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]+)?$" } };
6532
6543
 
6533
6544
  var data$f = { adg_os_any:{ name:"removeheader",
@@ -6555,6 +6566,7 @@ var data$f = { adg_os_any:{ name:"removeheader",
6555
6566
  inverse_conflicts:true,
6556
6567
  assignable:true,
6557
6568
  negatable:false,
6569
+ value_optional:true,
6558
6570
  value_format:"(?xi)\n ^\n # Value may start with \"request:\"\n (request:)?\n\n # Forbidden header names\n (?!\n (\n access-control-allow-origin|\n access-control-allow-credentials|\n access-control-allow-headers|\n access-control-allow-methods|\n access-control-expose-headers|\n access-control-max-age|\n access-control-request-headers|\n access-control-request-method|\n origin|\n timing-allow-origin|\n allow|\n cross-origin-embedder-policy|\n cross-origin-opener-policy|\n cross-origin-resource-policy|\n content-security-policy|\n content-security-policy-report-only|\n expect-ct|\n feature-policy|\n origin-isolation|\n strict-transport-security|\n upgrade-insecure-requests|\n x-content-type-options|\n x-download-options|\n x-frame-options|\n x-permitted-cross-domain-policies|\n x-powered-by|\n x-xss-protection|\n public-key-pins|\n public-key-pins-report-only|\n sec-websocket-key|\n sec-websocket-extensions|\n sec-websocket-accept|\n sec-websocket-protocol|\n sec-websocket-version|\n p3p|\n sec-fetch-mode|\n sec-fetch-dest|\n sec-fetch-site|\n sec-fetch-user|\n referrer-policy|\n content-type|\n content-length|\n accept|\n accept-encoding|\n host|\n connection|\n transfer-encoding|\n upgrade\n )\n $)\n\n # Any other header name is allowed, if it matches the following regex\n [A-z0-9-]+\n $" },
6559
6571
  adg_ext_any:{ name:"removeheader",
6560
6572
  description:"Rules with the `$removeheader` modifier are intended to remove headers from HTTP requests and responses.",
@@ -6581,6 +6593,7 @@ var data$f = { adg_os_any:{ name:"removeheader",
6581
6593
  inverse_conflicts:true,
6582
6594
  assignable:true,
6583
6595
  negatable:false,
6596
+ value_optional:true,
6584
6597
  value_format:"(?xi)\n ^\n # Value may start with \"request:\"\n (request:)?\n\n # Forbidden header names\n (?!\n (\n access-control-allow-origin|\n access-control-allow-credentials|\n access-control-allow-headers|\n access-control-allow-methods|\n access-control-expose-headers|\n access-control-max-age|\n access-control-request-headers|\n access-control-request-method|\n origin|\n timing-allow-origin|\n allow|\n cross-origin-embedder-policy|\n cross-origin-opener-policy|\n cross-origin-resource-policy|\n content-security-policy|\n content-security-policy-report-only|\n expect-ct|\n feature-policy|\n origin-isolation|\n strict-transport-security|\n upgrade-insecure-requests|\n x-content-type-options|\n x-download-options|\n x-frame-options|\n x-permitted-cross-domain-policies|\n x-powered-by|\n x-xss-protection|\n public-key-pins|\n public-key-pins-report-only|\n sec-websocket-key|\n sec-websocket-extensions|\n sec-websocket-accept|\n sec-websocket-protocol|\n sec-websocket-version|\n p3p|\n sec-fetch-mode|\n sec-fetch-dest|\n sec-fetch-site|\n sec-fetch-user|\n referrer-policy|\n content-type|\n content-length|\n accept|\n accept-encoding|\n host|\n connection|\n transfer-encoding|\n upgrade\n )\n $)\n\n # Any other header name is allowed, if it matches the following regex\n [A-z0-9-]+\n $" } };
6585
6598
 
6586
6599
  var data$e = { adg_os_any:{ name:"removeparam",
@@ -6588,12 +6601,14 @@ var data$e = { adg_os_any:{ name:"removeparam",
6588
6601
  docs:"https://adguard.app/kb/general/ad-filtering/create-own-filters/#removeparam-modifier",
6589
6602
  assignable:true,
6590
6603
  negatable:false,
6604
+ value_optional:true,
6591
6605
  value_format:"/^(?!.*([^\\\\](,|\\$|\\/))).*$/" },
6592
6606
  adg_ext_any:{ name:"removeparam",
6593
6607
  description:"Rules with the `$removeparam` modifier are intended to strip query parameters from requests' URLs.",
6594
6608
  docs:"https://adguard.app/kb/general/ad-filtering/create-own-filters/#removeparam-modifier",
6595
6609
  assignable:true,
6596
6610
  negatable:false,
6611
+ value_optional:true,
6597
6612
  value_format:"/^(?!.*([^\\\\](,|\\$|\\/))).*$/" },
6598
6613
  ubo_ext_any:{ name:"removeparam",
6599
6614
  description:"Rules with the `$removeparam` modifier are intended to strip query parameters from requests' URLs.",
@@ -6681,6 +6696,7 @@ var data$a = { adg_os_any:{ name:"stealth",
6681
6696
  assignable:true,
6682
6697
  negatable:false,
6683
6698
  exception_only:true,
6699
+ value_optional:true,
6684
6700
  value_format:"(?x)\n ^(?!\\|)\\b(?:(\n searchqueries|\n donottrack|\n 3p-cookie|\n 1p-cookie|\n 3p-cache|\n 3p-auth|\n webrtc|\n push|\n location|\n flash|\n java|\n referrer|\n useragent|\n ip|\n xclientdata|\n dpi|\n \\|?\n )\\b)+(?<!\\|)$" },
6685
6701
  adg_ext_chrome:{ name:"stealth",
6686
6702
  description:"Disables the Stealth Mode module for all corresponding pages and requests.",
@@ -6688,6 +6704,7 @@ var data$a = { adg_os_any:{ name:"stealth",
6688
6704
  assignable:true,
6689
6705
  negatable:false,
6690
6706
  exception_only:true,
6707
+ value_optional:true,
6691
6708
  value_format:"(?x)\n ^(?!\\|)\\b(?:(\n searchqueries|\n donottrack|\n 3p-cookie|\n 1p-cookie|\n webrtc|\n referrer|\n xclientdata\n |\\|?\n )\\b)+(?<!\\|)$" },
6692
6709
  adg_ext_firefox:{ name:"stealth",
6693
6710
  description:"Disables the Stealth Mode module for all corresponding pages and requests.",
@@ -6695,6 +6712,7 @@ var data$a = { adg_os_any:{ name:"stealth",
6695
6712
  assignable:true,
6696
6713
  negatable:false,
6697
6714
  exception_only:true,
6715
+ value_optional:true,
6698
6716
  value_format:"(?x)\n ^(?!\\|)\\b(?:(\n searchqueries|\n donottrack|\n 3p-cookie|\n 1p-cookie|\n webrtc|\n referrer|\n |\\|?\n )\\b)+(?<!\\|)$" },
6699
6717
  adg_ext_opera:{ name:"stealth",
6700
6718
  description:"Disables the Stealth Mode module for all corresponding pages and requests.",
@@ -6702,6 +6720,7 @@ var data$a = { adg_os_any:{ name:"stealth",
6702
6720
  assignable:true,
6703
6721
  negatable:false,
6704
6722
  exception_only:true,
6723
+ value_optional:true,
6705
6724
  value_format:"(?x)\n ^(?!\\|)\\b(?:(\n searchqueries|\n donottrack|\n 3p-cookie|\n 1p-cookie|\n webrtc|\n referrer|\n |\\|?\n )\\b)+(?<!\\|)$" },
6706
6725
  adg_ext_edge:{ name:"stealth",
6707
6726
  description:"Disables the Stealth Mode module for all corresponding pages and requests.",
@@ -6709,6 +6728,7 @@ var data$a = { adg_os_any:{ name:"stealth",
6709
6728
  assignable:true,
6710
6729
  negatable:false,
6711
6730
  exception_only:true,
6731
+ value_optional:true,
6712
6732
  value_format:"(?x)\n ^(?!\\|)\\b(?:(\n searchqueries|\n donottrack|\n 3p-cookie|\n 1p-cookie|\n webrtc|\n referrer|\n |\\|?\n )\\b)+(?<!\\|)$" } };
6713
6733
 
6714
6734
  var data$9 = { ubo_any:{ name:"strict1p",
@@ -6912,6 +6932,9 @@ var SpecificKey;
6912
6932
  SpecificKey["Negatable"] = "negatable";
6913
6933
  SpecificKey["BlockOnly"] = "block_only";
6914
6934
  SpecificKey["ExceptionOnly"] = "exception_only";
6935
+ // TODO: consider removing this field
6936
+ // and handle whether the value is optional by `value_format`. AG-24028
6937
+ SpecificKey["ValueOptional"] = "value_optional";
6915
6938
  SpecificKey["ValueFormat"] = "value_format";
6916
6939
  // TODO: following fields should be handled later
6917
6940
  // VersionAdded = 'version_added',
@@ -6950,6 +6973,7 @@ const prepareBlockerData = (blockerId, rawModifierData) => {
6950
6973
  : rawData[SpecificKey.Negatable],
6951
6974
  [SpecificKey.BlockOnly]: rawData[SpecificKey.BlockOnly] || false,
6952
6975
  [SpecificKey.ExceptionOnly]: rawData[SpecificKey.ExceptionOnly] || false,
6976
+ [SpecificKey.ValueOptional]: rawData[SpecificKey.ValueOptional] || false,
6953
6977
  [SpecificKey.ValueFormat]: rawData[SpecificKey.ValueFormat] || null,
6954
6978
  };
6955
6979
  return blockerData;
@@ -7110,18 +7134,20 @@ const validateForSpecificSyntax = (modifiersData, syntax, modifier, isException)
7110
7134
  // e.g. 'domain'
7111
7135
  if (specificBlockerData.assignable) {
7112
7136
  /**
7113
- * exception_only modifier 'stealth' is assignable
7114
- * but it also may be used without value as well -- `$stealth` or `$stealth=dpi`
7137
+ * Some assignable modifiers can be used without a value,
7138
+ * e.g. '@@||example.com^$cookie'.
7115
7139
  */
7116
7140
  if (!modifier.value
7117
- /**
7118
- * TODO: consider to return `{ ok: true, warn: 'Modifier value may be specified' }` (???)
7119
- * after the extension will support stealth mode with value
7120
- * https://github.com/AdguardTeam/AdguardBrowserExtension/issues/2107
7121
- */
7122
- && !specificBlockerData.exception_only) {
7141
+ // value should be specified if it is not optional
7142
+ && !specificBlockerData.value_optional) {
7123
7143
  return getInvalidValidationResult(`${INVALID_ERROR_PREFIX.VALUE_REQUIRED}: '${modifierName}'`);
7124
7144
  }
7145
+ /**
7146
+ * TODO: consider to return `{ ok: true, warn: 'Modifier value may be specified' }` (???)
7147
+ * for $stealth modifier without a value
7148
+ * but only after the extension will support value for $stealth:
7149
+ * https://github.com/AdguardTeam/AdguardBrowserExtension/issues/2107
7150
+ */
7125
7151
  }
7126
7152
  else if (modifier?.value) {
7127
7153
  return getInvalidValidationResult(`${INVALID_ERROR_PREFIX.VALUE_FORBIDDEN}: '${modifierName}'`);
@@ -8868,7 +8894,7 @@ class LogicalExpressionUtils {
8868
8894
  }
8869
8895
  }
8870
8896
 
8871
- const version$1 = "1.1.0";
8897
+ const version$1 = "1.1.1";
8872
8898
 
8873
8899
  /**
8874
8900
  * @file AGTree version
package/dist/agtree.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- * AGTree v1.1.0 (build date: Thu, 10 Aug 2023 15:16:26 GMT)
2
+ * AGTree v1.1.1 (build date: Fri, 11 Aug 2023 13:11:01 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
@@ -1,5 +1,5 @@
1
1
  /*
2
- * AGTree v1.1.0 (build date: Thu, 10 Aug 2023 15:16:26 GMT)
2
+ * AGTree v1.1.1 (build date: Fri, 11 Aug 2023 13:11:01 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
@@ -5818,12 +5818,14 @@ var data$O = { adg_os_any:{ name:"cookie",
5818
5818
  docs:"https://adguard.app/kb/general/ad-filtering/create-own-filters/#cookie-modifier",
5819
5819
  assignable:true,
5820
5820
  negatable:false,
5821
+ value_optional:true,
5821
5822
  value_format:"^([^;=\\s]*?)((?:;(maxAge=\\d+;?)?|(sameSite=(lax|none|strict);?)?){1,3})(?<!;)$" },
5822
5823
  adg_ext_any:{ name:"cookie",
5823
5824
  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.",
5824
5825
  docs:"https://adguard.app/kb/general/ad-filtering/create-own-filters/#cookie-modifier",
5825
5826
  assignable:true,
5826
5827
  negatable:false,
5828
+ value_optional:true,
5827
5829
  value_format:"^([^;=\\s]*?)((?:;(maxAge=\\d+;?)?|(sameSite=(lax|none|strict);?)?){1,3})(?<!;)$" } };
5828
5830
 
5829
5831
  var data$N = { adg_os_any:{ name:"csp",
@@ -5836,6 +5838,7 @@ var data$N = { adg_os_any:{ name:"csp",
5836
5838
  inverse_conflicts:true,
5837
5839
  assignable:true,
5838
5840
  negatable:false,
5841
+ value_optional:true,
5839
5842
  value_format:"/[^,$]+/" },
5840
5843
  adg_ext_any:{ name:"csp",
5841
5844
  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.",
@@ -5847,6 +5850,7 @@ var data$N = { adg_os_any:{ name:"csp",
5847
5850
  inverse_conflicts:true,
5848
5851
  assignable:true,
5849
5852
  negatable:false,
5853
+ value_optional:true,
5850
5854
  value_format:"/[^,$]+/" },
5851
5855
  abp_ext_any:{ name:"csp",
5852
5856
  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.",
@@ -5856,6 +5860,7 @@ var data$N = { adg_os_any:{ name:"csp",
5856
5860
  inverse_conflicts:true,
5857
5861
  assignable:true,
5858
5862
  negatable:false,
5863
+ value_optional:true,
5859
5864
  value_format:"/[^,$]+/" },
5860
5865
  ubo_ext_any:{ name:"csp",
5861
5866
  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.",
@@ -5867,6 +5872,7 @@ var data$N = { adg_os_any:{ name:"csp",
5867
5872
  inverse_conflicts:true,
5868
5873
  assignable:true,
5869
5874
  negatable:false,
5875
+ value_optional:true,
5870
5876
  value_format:"/[^,$]+/" } };
5871
5877
 
5872
5878
  var data$M = { adg_os_any:{ name:"denyallow",
@@ -6432,6 +6438,7 @@ var data$h = { adg_os_any:{ name:"redirect-rule",
6432
6438
  inverse_conflicts:true,
6433
6439
  assignable:true,
6434
6440
  negatable:false,
6441
+ value_optional:true,
6435
6442
  value_format:"(?x)\n ^(\n 1x1-transparent\\.gif|\n 2x2-transparent\\.png|\n 3x2-transparent\\.png|\n 32x32-transparent\\.png|\n noopframe|\n noopcss|\n noopjs|\n noopjson|\n nooptext|\n empty|\n noopvmap-1\\.0|\n noopvast-2\\.0|\n noopvast-3\\.0|\n noopvast-4\\.0|\n noopmp3-0\\.1s|\n noopmp4-1s|\n amazon-apstag|\n ati-smarttag|\n didomi-loader|\n fingerprintjs2|\n fingerprintjs3|\n gemius|\n google-analytics-ga|\n google-analytics|\n google-ima3|\n googlesyndication-adsbygoogle|\n googletagservices-gpt|\n matomo|\n metrika-yandex-tag|\n metrika-yandex-watch|\n naver-wcslog|\n noeval|\n pardot-1\\.0|\n prebid-ads|\n prebid|\n prevent-bab|\n prevent-bab2|\n prevent-fab-3\\.2\\.0|\n prevent-popads-net|\n scorecardresearch-beacon|\n set-popads-dummy|\n click2load\\.html|\n )?$" },
6436
6443
  adg_ext_any:{ name:"redirect-rule",
6437
6444
  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.",
@@ -6461,6 +6468,7 @@ var data$h = { adg_os_any:{ name:"redirect-rule",
6461
6468
  inverse_conflicts:true,
6462
6469
  assignable:true,
6463
6470
  negatable:false,
6471
+ value_optional:true,
6464
6472
  value_format:"(?x)\n ^(\n 1x1-transparent\\.gif|\n 2x2-transparent\\.png|\n 3x2-transparent\\.png|\n 32x32-transparent\\.png|\n noopframe|\n noopcss|\n noopjs|\n noopjson|\n nooptext|\n empty|\n noopvmap-1\\.0|\n noopvast-2\\.0|\n noopvast-3\\.0|\n noopvast-4\\.0|\n noopmp3-0\\.1s|\n noopmp4-1s|\n amazon-apstag|\n ati-smarttag|\n didomi-loader|\n fingerprintjs2|\n fingerprintjs3|\n gemius|\n google-analytics-ga|\n google-analytics|\n google-ima3|\n googlesyndication-adsbygoogle|\n googletagservices-gpt|\n matomo|\n metrika-yandex-tag|\n metrika-yandex-watch|\n naver-wcslog|\n noeval|\n pardot-1\\.0|\n prebid-ads|\n prebid|\n prevent-bab|\n prevent-bab2|\n prevent-fab-3\\.2\\.0|\n prevent-popads-net|\n scorecardresearch-beacon|\n set-popads-dummy|\n click2load\\.html|\n )?$" },
6465
6473
  ubo_ext_any:{ name:"redirect-rule",
6466
6474
  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.",
@@ -6497,18 +6505,21 @@ var data$g = { adg_os_any:{ name:"redirect",
6497
6505
  docs:"https://adguard.app/kb/general/ad-filtering/create-own-filters/#redirect-modifier",
6498
6506
  assignable:true,
6499
6507
  negatable:false,
6508
+ value_optional:true,
6500
6509
  value_format:"(?x)\n ^(\n 1x1-transparent\\.gif|\n 2x2-transparent\\.png|\n 3x2-transparent\\.png|\n 32x32-transparent\\.png|\n noopframe|\n noopcss|\n noopjs|\n noopjson|\n nooptext|\n empty|\n noopvmap-1\\.0|\n noopvast-2\\.0|\n noopvast-3\\.0|\n noopvast-4\\.0|\n noopmp3-0\\.1s|\n noopmp4-1s|\n amazon-apstag|\n ati-smarttag|\n didomi-loader|\n fingerprintjs2|\n fingerprintjs3|\n gemius|\n google-analytics-ga|\n google-analytics|\n google-ima3|\n googlesyndication-adsbygoogle|\n googletagservices-gpt|\n matomo|\n metrika-yandex-tag|\n metrika-yandex-watch|\n naver-wcslog|\n noeval|\n pardot-1\\.0|\n prebid-ads|\n prebid|\n prevent-bab|\n prevent-bab2|\n prevent-fab-3\\.2\\.0|\n prevent-popads-net|\n scorecardresearch-beacon|\n set-popads-dummy|\n click2load\\.html\n )?$" },
6501
6510
  adg_ext_any:{ name:"redirect",
6502
6511
  description:"Used to redirect web requests to a local \"resource\".",
6503
6512
  docs:"https://adguard.app/kb/general/ad-filtering/create-own-filters/#redirect-modifier",
6504
6513
  assignable:true,
6505
6514
  negatable:false,
6515
+ value_optional:true,
6506
6516
  value_format:"(?x)\n ^(\n 1x1-transparent\\.gif|\n 2x2-transparent\\.png|\n 3x2-transparent\\.png|\n 32x32-transparent\\.png|\n noopframe|\n noopcss|\n noopjs|\n noopjson|\n nooptext|\n empty|\n noopvmap-1\\.0|\n noopvast-2\\.0|\n noopvast-3\\.0|\n noopvast-4\\.0|\n noopmp3-0\\.1s|\n noopmp4-1s|\n amazon-apstag|\n ati-smarttag|\n didomi-loader|\n fingerprintjs2|\n fingerprintjs3|\n gemius|\n google-analytics-ga|\n google-analytics|\n google-ima3|\n googlesyndication-adsbygoogle|\n googletagservices-gpt|\n matomo|\n metrika-yandex-tag|\n metrika-yandex-watch|\n naver-wcslog|\n noeval|\n pardot-1\\.0|\n prebid-ads|\n prebid|\n prevent-bab|\n prevent-bab2|\n prevent-fab-3\\.2\\.0|\n prevent-popads-net|\n scorecardresearch-beacon|\n set-popads-dummy|\n click2load\\.html\n )?$" },
6507
6517
  ubo_ext_any:{ name:"redirect",
6508
6518
  description:"Used to redirect web requests to a local \"resource\".",
6509
6519
  docs:"https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#redirect",
6510
6520
  assignable:true,
6511
6521
  negatable:false,
6522
+ value_optional:true,
6512
6523
  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]+)?$" } };
6513
6524
 
6514
6525
  var data$f = { adg_os_any:{ name:"removeheader",
@@ -6536,6 +6547,7 @@ var data$f = { adg_os_any:{ name:"removeheader",
6536
6547
  inverse_conflicts:true,
6537
6548
  assignable:true,
6538
6549
  negatable:false,
6550
+ value_optional:true,
6539
6551
  value_format:"(?xi)\n ^\n # Value may start with \"request:\"\n (request:)?\n\n # Forbidden header names\n (?!\n (\n access-control-allow-origin|\n access-control-allow-credentials|\n access-control-allow-headers|\n access-control-allow-methods|\n access-control-expose-headers|\n access-control-max-age|\n access-control-request-headers|\n access-control-request-method|\n origin|\n timing-allow-origin|\n allow|\n cross-origin-embedder-policy|\n cross-origin-opener-policy|\n cross-origin-resource-policy|\n content-security-policy|\n content-security-policy-report-only|\n expect-ct|\n feature-policy|\n origin-isolation|\n strict-transport-security|\n upgrade-insecure-requests|\n x-content-type-options|\n x-download-options|\n x-frame-options|\n x-permitted-cross-domain-policies|\n x-powered-by|\n x-xss-protection|\n public-key-pins|\n public-key-pins-report-only|\n sec-websocket-key|\n sec-websocket-extensions|\n sec-websocket-accept|\n sec-websocket-protocol|\n sec-websocket-version|\n p3p|\n sec-fetch-mode|\n sec-fetch-dest|\n sec-fetch-site|\n sec-fetch-user|\n referrer-policy|\n content-type|\n content-length|\n accept|\n accept-encoding|\n host|\n connection|\n transfer-encoding|\n upgrade\n )\n $)\n\n # Any other header name is allowed, if it matches the following regex\n [A-z0-9-]+\n $" },
6540
6552
  adg_ext_any:{ name:"removeheader",
6541
6553
  description:"Rules with the `$removeheader` modifier are intended to remove headers from HTTP requests and responses.",
@@ -6562,6 +6574,7 @@ var data$f = { adg_os_any:{ name:"removeheader",
6562
6574
  inverse_conflicts:true,
6563
6575
  assignable:true,
6564
6576
  negatable:false,
6577
+ value_optional:true,
6565
6578
  value_format:"(?xi)\n ^\n # Value may start with \"request:\"\n (request:)?\n\n # Forbidden header names\n (?!\n (\n access-control-allow-origin|\n access-control-allow-credentials|\n access-control-allow-headers|\n access-control-allow-methods|\n access-control-expose-headers|\n access-control-max-age|\n access-control-request-headers|\n access-control-request-method|\n origin|\n timing-allow-origin|\n allow|\n cross-origin-embedder-policy|\n cross-origin-opener-policy|\n cross-origin-resource-policy|\n content-security-policy|\n content-security-policy-report-only|\n expect-ct|\n feature-policy|\n origin-isolation|\n strict-transport-security|\n upgrade-insecure-requests|\n x-content-type-options|\n x-download-options|\n x-frame-options|\n x-permitted-cross-domain-policies|\n x-powered-by|\n x-xss-protection|\n public-key-pins|\n public-key-pins-report-only|\n sec-websocket-key|\n sec-websocket-extensions|\n sec-websocket-accept|\n sec-websocket-protocol|\n sec-websocket-version|\n p3p|\n sec-fetch-mode|\n sec-fetch-dest|\n sec-fetch-site|\n sec-fetch-user|\n referrer-policy|\n content-type|\n content-length|\n accept|\n accept-encoding|\n host|\n connection|\n transfer-encoding|\n upgrade\n )\n $)\n\n # Any other header name is allowed, if it matches the following regex\n [A-z0-9-]+\n $" } };
6566
6579
 
6567
6580
  var data$e = { adg_os_any:{ name:"removeparam",
@@ -6569,12 +6582,14 @@ var data$e = { adg_os_any:{ name:"removeparam",
6569
6582
  docs:"https://adguard.app/kb/general/ad-filtering/create-own-filters/#removeparam-modifier",
6570
6583
  assignable:true,
6571
6584
  negatable:false,
6585
+ value_optional:true,
6572
6586
  value_format:"/^(?!.*([^\\\\](,|\\$|\\/))).*$/" },
6573
6587
  adg_ext_any:{ name:"removeparam",
6574
6588
  description:"Rules with the `$removeparam` modifier are intended to strip query parameters from requests' URLs.",
6575
6589
  docs:"https://adguard.app/kb/general/ad-filtering/create-own-filters/#removeparam-modifier",
6576
6590
  assignable:true,
6577
6591
  negatable:false,
6592
+ value_optional:true,
6578
6593
  value_format:"/^(?!.*([^\\\\](,|\\$|\\/))).*$/" },
6579
6594
  ubo_ext_any:{ name:"removeparam",
6580
6595
  description:"Rules with the `$removeparam` modifier are intended to strip query parameters from requests' URLs.",
@@ -6662,6 +6677,7 @@ var data$a = { adg_os_any:{ name:"stealth",
6662
6677
  assignable:true,
6663
6678
  negatable:false,
6664
6679
  exception_only:true,
6680
+ value_optional:true,
6665
6681
  value_format:"(?x)\n ^(?!\\|)\\b(?:(\n searchqueries|\n donottrack|\n 3p-cookie|\n 1p-cookie|\n 3p-cache|\n 3p-auth|\n webrtc|\n push|\n location|\n flash|\n java|\n referrer|\n useragent|\n ip|\n xclientdata|\n dpi|\n \\|?\n )\\b)+(?<!\\|)$" },
6666
6682
  adg_ext_chrome:{ name:"stealth",
6667
6683
  description:"Disables the Stealth Mode module for all corresponding pages and requests.",
@@ -6669,6 +6685,7 @@ var data$a = { adg_os_any:{ name:"stealth",
6669
6685
  assignable:true,
6670
6686
  negatable:false,
6671
6687
  exception_only:true,
6688
+ value_optional:true,
6672
6689
  value_format:"(?x)\n ^(?!\\|)\\b(?:(\n searchqueries|\n donottrack|\n 3p-cookie|\n 1p-cookie|\n webrtc|\n referrer|\n xclientdata\n |\\|?\n )\\b)+(?<!\\|)$" },
6673
6690
  adg_ext_firefox:{ name:"stealth",
6674
6691
  description:"Disables the Stealth Mode module for all corresponding pages and requests.",
@@ -6676,6 +6693,7 @@ var data$a = { adg_os_any:{ name:"stealth",
6676
6693
  assignable:true,
6677
6694
  negatable:false,
6678
6695
  exception_only:true,
6696
+ value_optional:true,
6679
6697
  value_format:"(?x)\n ^(?!\\|)\\b(?:(\n searchqueries|\n donottrack|\n 3p-cookie|\n 1p-cookie|\n webrtc|\n referrer|\n |\\|?\n )\\b)+(?<!\\|)$" },
6680
6698
  adg_ext_opera:{ name:"stealth",
6681
6699
  description:"Disables the Stealth Mode module for all corresponding pages and requests.",
@@ -6683,6 +6701,7 @@ var data$a = { adg_os_any:{ name:"stealth",
6683
6701
  assignable:true,
6684
6702
  negatable:false,
6685
6703
  exception_only:true,
6704
+ value_optional:true,
6686
6705
  value_format:"(?x)\n ^(?!\\|)\\b(?:(\n searchqueries|\n donottrack|\n 3p-cookie|\n 1p-cookie|\n webrtc|\n referrer|\n |\\|?\n )\\b)+(?<!\\|)$" },
6687
6706
  adg_ext_edge:{ name:"stealth",
6688
6707
  description:"Disables the Stealth Mode module for all corresponding pages and requests.",
@@ -6690,6 +6709,7 @@ var data$a = { adg_os_any:{ name:"stealth",
6690
6709
  assignable:true,
6691
6710
  negatable:false,
6692
6711
  exception_only:true,
6712
+ value_optional:true,
6693
6713
  value_format:"(?x)\n ^(?!\\|)\\b(?:(\n searchqueries|\n donottrack|\n 3p-cookie|\n 1p-cookie|\n webrtc|\n referrer|\n |\\|?\n )\\b)+(?<!\\|)$" } };
6694
6714
 
6695
6715
  var data$9 = { ubo_any:{ name:"strict1p",
@@ -6893,6 +6913,9 @@ var SpecificKey;
6893
6913
  SpecificKey["Negatable"] = "negatable";
6894
6914
  SpecificKey["BlockOnly"] = "block_only";
6895
6915
  SpecificKey["ExceptionOnly"] = "exception_only";
6916
+ // TODO: consider removing this field
6917
+ // and handle whether the value is optional by `value_format`. AG-24028
6918
+ SpecificKey["ValueOptional"] = "value_optional";
6896
6919
  SpecificKey["ValueFormat"] = "value_format";
6897
6920
  // TODO: following fields should be handled later
6898
6921
  // VersionAdded = 'version_added',
@@ -6931,6 +6954,7 @@ const prepareBlockerData = (blockerId, rawModifierData) => {
6931
6954
  : rawData[SpecificKey.Negatable],
6932
6955
  [SpecificKey.BlockOnly]: rawData[SpecificKey.BlockOnly] || false,
6933
6956
  [SpecificKey.ExceptionOnly]: rawData[SpecificKey.ExceptionOnly] || false,
6957
+ [SpecificKey.ValueOptional]: rawData[SpecificKey.ValueOptional] || false,
6934
6958
  [SpecificKey.ValueFormat]: rawData[SpecificKey.ValueFormat] || null,
6935
6959
  };
6936
6960
  return blockerData;
@@ -7091,18 +7115,20 @@ const validateForSpecificSyntax = (modifiersData, syntax, modifier, isException)
7091
7115
  // e.g. 'domain'
7092
7116
  if (specificBlockerData.assignable) {
7093
7117
  /**
7094
- * exception_only modifier 'stealth' is assignable
7095
- * but it also may be used without value as well -- `$stealth` or `$stealth=dpi`
7118
+ * Some assignable modifiers can be used without a value,
7119
+ * e.g. '@@||example.com^$cookie'.
7096
7120
  */
7097
7121
  if (!modifier.value
7098
- /**
7099
- * TODO: consider to return `{ ok: true, warn: 'Modifier value may be specified' }` (???)
7100
- * after the extension will support stealth mode with value
7101
- * https://github.com/AdguardTeam/AdguardBrowserExtension/issues/2107
7102
- */
7103
- && !specificBlockerData.exception_only) {
7122
+ // value should be specified if it is not optional
7123
+ && !specificBlockerData.value_optional) {
7104
7124
  return getInvalidValidationResult(`${INVALID_ERROR_PREFIX.VALUE_REQUIRED}: '${modifierName}'`);
7105
7125
  }
7126
+ /**
7127
+ * TODO: consider to return `{ ok: true, warn: 'Modifier value may be specified' }` (???)
7128
+ * for $stealth modifier without a value
7129
+ * but only after the extension will support value for $stealth:
7130
+ * https://github.com/AdguardTeam/AdguardBrowserExtension/issues/2107
7131
+ */
7106
7132
  }
7107
7133
  else if (modifier?.value) {
7108
7134
  return getInvalidValidationResult(`${INVALID_ERROR_PREFIX.VALUE_FORBIDDEN}: '${modifierName}'`);
@@ -8849,7 +8875,7 @@ class LogicalExpressionUtils {
8849
8875
  }
8850
8876
  }
8851
8877
 
8852
- const version$1 = "1.1.0";
8878
+ const version$1 = "1.1.1";
8853
8879
 
8854
8880
  /**
8855
8881
  * @file AGTree version