@@ -627,9 +627,13 @@ The modifier part, `":" h_value`, may be omitted. In that case, the modifier mat
627
627
628
628
1 . The ` $header ` modifier can be matched only when headers are received.
629
629
So if the request is blocked or redirected at an earlier stage, the modifier cannot be applied.
630
+
630
631
1 . In AdGuard Browser Extension, the ` $header ` modifier is only compatible with
631
- [ ` $csp ` ] ( #csp-modifier ) , [ ` $removeheader ` ] ( #removeheader-modifier ) , [ ` $important ` ] ( #important-modifier ) ,
632
- and [ ` $badfilter ` ] ( #badfilter-modifier ) .
632
+ [ ` $csp ` ] ( #csp-modifier ) , [ ` $removeheader ` ] ( #removeheader-modifier ) (response headers only), [ ` $important ` ] ( #important-modifier ) ,
633
+ [ ` $badfilter ` ] ( #badfilter-modifier ) , [ ` $domain ` ] ( #domain-modifier ) , [ ` $third-party ` ] ( #third-party-modifier ) ,
634
+ [ ` $match-case ` ] ( #match-case-modifier ) , and [ content-type modifiers] ( #content-type-modifiers ) such as
635
+ [ ` $script ` ] ( #script-modifier ) and [ ` $stylesheet ` ] ( #stylesheet-modifier ) . The rules with other modifiers
636
+ are considered invalid and will be discarded.
633
637
634
638
:::
635
639
@@ -1388,7 +1392,7 @@ These modifiers are able to completely change the behavior of basic rules.
1388
1392
| [ $redirect] ( #redirect-modifier ) | ✅ | ✅ | ✅ [ * [ 5]] ( #redirect-modifier-limitations ) | ✅ | ❌ | ❌ | ❌ |
1389
1393
| [ $redirect-rule] ( #redirect-rule-modifier ) | ✅ | ✅ | ❌ | ✅ | ❌ | ❌ | ❌ |
1390
1394
| [ $referrerpolicy] ( #referrerpolicy-modifier ) | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
1391
- | [ $removeheader] ( #removeheader-modifier ) | ✅ | ✅ | ❌ | ✅ | ❌ | ❌ | ❌ |
1395
+ | [ $removeheader] ( #removeheader-modifier ) | ✅ | ✅ [ * [ 7 ]] ( #removeheader-modifier-limitations ) | ✅ [ * [ 7 ]] ( #removeheader-modifier-limitations ) | ✅ [ * [ 7 ]] ( #removeheader-modifier-limitations ) | ❌ | ❌ | ❌ |
1392
1396
| [ $removeparam] ( #removeparam-modifier ) | ✅ | ✅ | ✅ [ * [ 6]] ( #removeparam-modifier-limitations ) | ✅ | ❌ | ❌ | ❌ |
1393
1397
| [ $replace] ( #replace-modifier ) | ✅ | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ |
1394
1398
| [ $urltransform] ( #urltransform-modifier ) | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
@@ -2456,6 +2460,74 @@ In case of multiple `$removeheader` rules matching a single request, we will app
2456
2460
@@||example.org/path/$removeheader
2457
2461
```
2458
2462
2463
+ ##### `$removeheader` modifier limitations {#removeheader-modifier-limitations}
2464
+
2465
+ :::caution Limitations
2466
+
2467
+ [AdGuard for Chrome MV3][ext-mv3] has some limitations:
2468
+
2469
+ - Negation and allowlist rules are not supported.
2470
+ - Group of similar `$removeheader` rules will be combined into one declarative rule. For example:
2471
+
2472
+ ```bash
2473
+ ||testcases.adguard.com$xmlhttprequest,removeheader=p1case1
2474
+ ||testcases.adguard.com$xmlhttprequest,removeheader=P2Case1
2475
+ $xmlhttprequest,removeheader=p1case2
2476
+ $xmlhttprequest,removeheader=P2case2
2477
+ ```
2478
+
2479
+ is converted to
2480
+
2481
+ ```bash
2482
+ [
2483
+ {
2484
+ "id": 1,
2485
+ "action": {
2486
+ "type": "modifyHeaders",
2487
+ "responseHeaders": [
2488
+ {
2489
+ "header": "p1case1",
2490
+ "operation": "remove"
2491
+ },
2492
+ {
2493
+ "header": "P2Case1",
2494
+ "operation": "remove"
2495
+ },
2496
+ ]
2497
+ },
2498
+ "condition": {
2499
+ "urlFilter": "||testcases.adguard.com",
2500
+ "resourceTypes": [
2501
+ "xmlhttprequest"
2502
+ ]
2503
+ }
2504
+ },
2505
+ {
2506
+ "id": 2,
2507
+ "action": {
2508
+ "type": "modifyHeaders",
2509
+ "responseHeaders": [
2510
+ {
2511
+ "header": "p1case2",
2512
+ "operation": "remove"
2513
+ },
2514
+ {
2515
+ "header": "P2case2",
2516
+ "operation": "remove"
2517
+ }
2518
+ ]
2519
+ },
2520
+ "condition": {
2521
+ "resourceTypes": [
2522
+ "xmlhttprequest"
2523
+ ]
2524
+ }
2525
+ }
2526
+ ]
2527
+ ```
2528
+
2529
+ :::
2530
+
2459
2531
:::caution Restrictions
2460
2532
2461
2533
This type of rules can only be used [**in trusted filters**](#trusted-filters).
0 commit comments