@adguard/agtree 2.0.0 → 2.0.2

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.
@@ -1,5 +1,5 @@
1
1
  /*
2
- * AGTree v2.0.0 (build date: Thu, 15 Aug 2024 15:06:58 GMT)
2
+ * AGTree v2.0.2 (build date: Tue, 10 Sep 2024 15:46:27 GMT)
3
3
  * (c) 2024 Adguard Software Ltd.
4
4
  * Released under the MIT license
5
5
  * https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
@@ -192,6 +192,7 @@ const NUMBERS = new Set([NUMBER_0, NUMBER_1, NUMBER_2, NUMBER_3, NUMBER_4, NUMBE
192
192
  const REGEX_MARKER = '/';
193
193
  const ADG_SCRIPTLET_MASK = '//scriptlet';
194
194
  const UBO_SCRIPTLET_MASK = '+js';
195
+ const UBO_SCRIPTLET_MASK_LEGACY = 'script:inject';
195
196
  const UBO_HTML_MASK = '^';
196
197
  // Modifiers are separated by ",". For example: "script,domain=example.com"
197
198
  const MODIFIERS_SEPARATOR = ',';
@@ -1128,6 +1129,15 @@ const isUndefined = value => {
1128
1129
  const isNull = value => {
1129
1130
  return value === null;
1130
1131
  };
1132
+ /**
1133
+ * Checks whether the given value is a string.
1134
+ *
1135
+ * @param value Value to check.
1136
+ * @returns `true` if the value is a string, `false` otherwise.
1137
+ */
1138
+ const isString = value => {
1139
+ return typeof value === 'string';
1140
+ };
1131
1141
  /**
1132
1142
  * Checks whether the given value is an array of Uint8Arrays.
1133
1143
  *
@@ -6318,11 +6328,17 @@ class UboScriptletInjectionBodyParser extends ParserBase {
6318
6328
  let offset = 0;
6319
6329
  // Skip leading spaces
6320
6330
  offset = StringUtils.skipWS(raw, offset);
6331
+ let scriptletMaskLength = 0;
6332
+ if (raw.startsWith(UBO_SCRIPTLET_MASK, offset)) {
6333
+ scriptletMaskLength = UBO_SCRIPTLET_MASK.length;
6334
+ } else if (raw.startsWith(UBO_SCRIPTLET_MASK_LEGACY, offset)) {
6335
+ scriptletMaskLength = UBO_SCRIPTLET_MASK_LEGACY.length;
6336
+ }
6321
6337
  // Scriptlet call should start with "+js"
6322
- if (!raw.startsWith(UBO_SCRIPTLET_MASK, offset)) {
6338
+ if (!scriptletMaskLength) {
6323
6339
  throw new AdblockSyntaxError(this.ERROR_MESSAGES.NO_SCRIPTLET_MASK, baseOffset + offset, baseOffset + raw.length);
6324
6340
  }
6325
- offset += UBO_SCRIPTLET_MASK.length;
6341
+ offset += scriptletMaskLength;
6326
6342
  // Whitespace is not allowed after the mask
6327
6343
  if (raw[offset] === SPACE) {
6328
6344
  throw new AdblockSyntaxError(this.ERROR_MESSAGES.WHITESPACE_AFTER_MASK, baseOffset + offset, baseOffset + raw.length);
@@ -6367,6 +6383,7 @@ class UboScriptletInjectionBodyParser extends ParserBase {
6367
6383
  if (node.children.length > 1) {
6368
6384
  throw new Error(this.ERROR_MESSAGES.NO_MULTIPLE_SCRIPTLET_CALLS);
6369
6385
  }
6386
+ // During generation, we only support the modern scriptlet mask
6370
6387
  result.push(UBO_SCRIPTLET_MASK);
6371
6388
  result.push(OPEN_PARENTHESIS);
6372
6389
  if (node.children.length > 0) {
@@ -6904,7 +6921,7 @@ class CosmeticRuleParser extends ParserBase {
6904
6921
  };
6905
6922
  };
6906
6923
  const parseUboScriptletInjection = () => {
6907
- if (!rawBody.startsWith(UBO_SCRIPTLET_MASK)) {
6924
+ if (!rawBody.startsWith(UBO_SCRIPTLET_MASK) && !rawBody.startsWith(UBO_SCRIPTLET_MASK_LEGACY)) {
6908
6925
  return null;
6909
6926
  }
6910
6927
  if (!options.parseUboSpecificRules) {
@@ -13859,7 +13876,8 @@ const redirectsCompatibilityTableData = {
13859
13876
  deprecationMessage: null,
13860
13877
  removed: false,
13861
13878
  removalMessage: null,
13862
- isBlocking: false
13879
+ isBlocking: false,
13880
+ resourceTypes: []
13863
13881
  }, {
13864
13882
  name: "1x1.gif",
13865
13883
  aliases: null,
@@ -13871,7 +13889,8 @@ const redirectsCompatibilityTableData = {
13871
13889
  deprecationMessage: null,
13872
13890
  removed: false,
13873
13891
  removalMessage: null,
13874
- isBlocking: false
13892
+ isBlocking: false,
13893
+ resourceTypes: ["image"]
13875
13894
  }, {
13876
13895
  name: "1x1-transparent-gif",
13877
13896
  aliases: null,
@@ -13883,7 +13902,8 @@ const redirectsCompatibilityTableData = {
13883
13902
  deprecationMessage: null,
13884
13903
  removed: false,
13885
13904
  removalMessage: null,
13886
- isBlocking: false
13905
+ isBlocking: false,
13906
+ resourceTypes: []
13887
13907
  }],
13888
13908
  map: {
13889
13909
  "1": 0,
@@ -13914,7 +13934,8 @@ const redirectsCompatibilityTableData = {
13914
13934
  deprecationMessage: null,
13915
13935
  removed: false,
13916
13936
  removalMessage: null,
13917
- isBlocking: false
13937
+ isBlocking: false,
13938
+ resourceTypes: []
13918
13939
  }, {
13919
13940
  name: "2x2.png",
13920
13941
  aliases: null,
@@ -13926,7 +13947,8 @@ const redirectsCompatibilityTableData = {
13926
13947
  deprecationMessage: null,
13927
13948
  removed: false,
13928
13949
  removalMessage: null,
13929
- isBlocking: false
13950
+ isBlocking: false,
13951
+ resourceTypes: ["image"]
13930
13952
  }, {
13931
13953
  name: "2x2-transparent-png",
13932
13954
  aliases: null,
@@ -13938,7 +13960,8 @@ const redirectsCompatibilityTableData = {
13938
13960
  deprecationMessage: null,
13939
13961
  removed: false,
13940
13962
  removalMessage: null,
13941
- isBlocking: false
13963
+ isBlocking: false,
13964
+ resourceTypes: []
13942
13965
  }],
13943
13966
  map: {
13944
13967
  "1": 0,
@@ -13969,7 +13992,8 @@ const redirectsCompatibilityTableData = {
13969
13992
  deprecationMessage: null,
13970
13993
  removed: false,
13971
13994
  removalMessage: null,
13972
- isBlocking: false
13995
+ isBlocking: false,
13996
+ resourceTypes: []
13973
13997
  }, {
13974
13998
  name: "32x32.png",
13975
13999
  aliases: null,
@@ -13981,7 +14005,8 @@ const redirectsCompatibilityTableData = {
13981
14005
  deprecationMessage: null,
13982
14006
  removed: false,
13983
14007
  removalMessage: null,
13984
- isBlocking: false
14008
+ isBlocking: false,
14009
+ resourceTypes: ["image"]
13985
14010
  }, {
13986
14011
  name: "32x32-transparent-png",
13987
14012
  aliases: null,
@@ -13993,7 +14018,8 @@ const redirectsCompatibilityTableData = {
13993
14018
  deprecationMessage: null,
13994
14019
  removed: false,
13995
14020
  removalMessage: null,
13996
- isBlocking: false
14021
+ isBlocking: false,
14022
+ resourceTypes: []
13997
14023
  }],
13998
14024
  map: {
13999
14025
  "1": 0,
@@ -14024,7 +14050,8 @@ const redirectsCompatibilityTableData = {
14024
14050
  deprecationMessage: null,
14025
14051
  removed: false,
14026
14052
  removalMessage: null,
14027
- isBlocking: false
14053
+ isBlocking: false,
14054
+ resourceTypes: []
14028
14055
  }, {
14029
14056
  name: "3x2.png",
14030
14057
  aliases: null,
@@ -14036,7 +14063,8 @@ const redirectsCompatibilityTableData = {
14036
14063
  deprecationMessage: null,
14037
14064
  removed: false,
14038
14065
  removalMessage: null,
14039
- isBlocking: false
14066
+ isBlocking: false,
14067
+ resourceTypes: ["image"]
14040
14068
  }, {
14041
14069
  name: "3x2-transparent-png",
14042
14070
  aliases: null,
@@ -14048,7 +14076,8 @@ const redirectsCompatibilityTableData = {
14048
14076
  deprecationMessage: null,
14049
14077
  removed: false,
14050
14078
  removalMessage: null,
14051
- isBlocking: false
14079
+ isBlocking: false,
14080
+ resourceTypes: []
14052
14081
  }],
14053
14082
  map: {
14054
14083
  "1": 0,
@@ -14079,7 +14108,8 @@ const redirectsCompatibilityTableData = {
14079
14108
  deprecationMessage: null,
14080
14109
  removed: false,
14081
14110
  removalMessage: null,
14082
- isBlocking: false
14111
+ isBlocking: false,
14112
+ resourceTypes: []
14083
14113
  }, {
14084
14114
  name: "amazon_apstag.js",
14085
14115
  aliases: null,
@@ -14091,7 +14121,8 @@ const redirectsCompatibilityTableData = {
14091
14121
  deprecationMessage: null,
14092
14122
  removed: false,
14093
14123
  removalMessage: null,
14094
- isBlocking: false
14124
+ isBlocking: false,
14125
+ resourceTypes: ["script"]
14095
14126
  }],
14096
14127
  map: {
14097
14128
  "1": 0,
@@ -14118,7 +14149,8 @@ const redirectsCompatibilityTableData = {
14118
14149
  deprecationMessage: null,
14119
14150
  removed: false,
14120
14151
  removalMessage: null,
14121
- isBlocking: false
14152
+ isBlocking: false,
14153
+ resourceTypes: ["script"]
14122
14154
  }],
14123
14155
  map: {
14124
14156
  "1024": 0,
@@ -14138,7 +14170,8 @@ const redirectsCompatibilityTableData = {
14138
14170
  deprecationMessage: null,
14139
14171
  removed: false,
14140
14172
  removalMessage: null,
14141
- isBlocking: false
14173
+ isBlocking: false,
14174
+ resourceTypes: ["script"]
14142
14175
  }],
14143
14176
  map: {
14144
14177
  "1024": 0,
@@ -14158,7 +14191,8 @@ const redirectsCompatibilityTableData = {
14158
14191
  deprecationMessage: null,
14159
14192
  removed: false,
14160
14193
  removalMessage: null,
14161
- isBlocking: false
14194
+ isBlocking: false,
14195
+ resourceTypes: []
14162
14196
  }],
14163
14197
  map: {
14164
14198
  "1": 0,
@@ -14181,7 +14215,8 @@ const redirectsCompatibilityTableData = {
14181
14215
  deprecationMessage: null,
14182
14216
  removed: false,
14183
14217
  removalMessage: null,
14184
- isBlocking: false
14218
+ isBlocking: false,
14219
+ resourceTypes: ["script"]
14185
14220
  }],
14186
14221
  map: {
14187
14222
  "1024": 0,
@@ -14201,7 +14236,8 @@ const redirectsCompatibilityTableData = {
14201
14236
  deprecationMessage: null,
14202
14237
  removed: false,
14203
14238
  removalMessage: null,
14204
- isBlocking: true
14239
+ isBlocking: true,
14240
+ resourceTypes: []
14205
14241
  }, {
14206
14242
  name: "click2load.html",
14207
14243
  aliases: null,
@@ -14213,7 +14249,8 @@ const redirectsCompatibilityTableData = {
14213
14249
  deprecationMessage: null,
14214
14250
  removed: false,
14215
14251
  removalMessage: null,
14216
- isBlocking: true
14252
+ isBlocking: true,
14253
+ resourceTypes: []
14217
14254
  }],
14218
14255
  map: {
14219
14256
  "1": 0,
@@ -14240,7 +14277,8 @@ const redirectsCompatibilityTableData = {
14240
14277
  deprecationMessage: null,
14241
14278
  removed: false,
14242
14279
  removalMessage: null,
14243
- isBlocking: false
14280
+ isBlocking: false,
14281
+ resourceTypes: []
14244
14282
  }],
14245
14283
  map: {
14246
14284
  "1": 0,
@@ -14263,7 +14301,8 @@ const redirectsCompatibilityTableData = {
14263
14301
  deprecationMessage: null,
14264
14302
  removed: false,
14265
14303
  removalMessage: null,
14266
- isBlocking: false
14304
+ isBlocking: false,
14305
+ resourceTypes: []
14267
14306
  }, {
14268
14307
  name: "empty",
14269
14308
  aliases: null,
@@ -14275,7 +14314,8 @@ const redirectsCompatibilityTableData = {
14275
14314
  deprecationMessage: null,
14276
14315
  removed: false,
14277
14316
  removalMessage: null,
14278
- isBlocking: false
14317
+ isBlocking: false,
14318
+ resourceTypes: []
14279
14319
  }],
14280
14320
  map: {
14281
14321
  "1": 0,
@@ -14302,7 +14342,8 @@ const redirectsCompatibilityTableData = {
14302
14342
  deprecationMessage: null,
14303
14343
  removed: false,
14304
14344
  removalMessage: null,
14305
- isBlocking: false
14345
+ isBlocking: false,
14346
+ resourceTypes: []
14306
14347
  }, {
14307
14348
  name: "fingerprint2.js",
14308
14349
  aliases: null,
@@ -14314,7 +14355,8 @@ const redirectsCompatibilityTableData = {
14314
14355
  deprecationMessage: null,
14315
14356
  removed: false,
14316
14357
  removalMessage: null,
14317
- isBlocking: false
14358
+ isBlocking: false,
14359
+ resourceTypes: ["script"]
14318
14360
  }],
14319
14361
  map: {
14320
14362
  "1": 0,
@@ -14341,7 +14383,8 @@ const redirectsCompatibilityTableData = {
14341
14383
  deprecationMessage: null,
14342
14384
  removed: false,
14343
14385
  removalMessage: null,
14344
- isBlocking: false
14386
+ isBlocking: false,
14387
+ resourceTypes: []
14345
14388
  }, {
14346
14389
  name: "fingerprint3.js",
14347
14390
  aliases: null,
@@ -14353,7 +14396,8 @@ const redirectsCompatibilityTableData = {
14353
14396
  deprecationMessage: null,
14354
14397
  removed: false,
14355
14398
  removalMessage: null,
14356
- isBlocking: false
14399
+ isBlocking: false,
14400
+ resourceTypes: ["script"]
14357
14401
  }],
14358
14402
  map: {
14359
14403
  "1": 0,
@@ -14380,7 +14424,8 @@ const redirectsCompatibilityTableData = {
14380
14424
  deprecationMessage: null,
14381
14425
  removed: false,
14382
14426
  removalMessage: null,
14383
- isBlocking: false
14427
+ isBlocking: false,
14428
+ resourceTypes: []
14384
14429
  }],
14385
14430
  map: {
14386
14431
  "1": 0,
@@ -14403,7 +14448,8 @@ const redirectsCompatibilityTableData = {
14403
14448
  deprecationMessage: null,
14404
14449
  removed: false,
14405
14450
  removalMessage: null,
14406
- isBlocking: false
14451
+ isBlocking: false,
14452
+ resourceTypes: []
14407
14453
  }, {
14408
14454
  name: "google-analytics_ga.js",
14409
14455
  aliases: null,
@@ -14415,7 +14461,8 @@ const redirectsCompatibilityTableData = {
14415
14461
  deprecationMessage: null,
14416
14462
  removed: false,
14417
14463
  removalMessage: null,
14418
- isBlocking: false
14464
+ isBlocking: false,
14465
+ resourceTypes: ["script"]
14419
14466
  }],
14420
14467
  map: {
14421
14468
  "1": 0,
@@ -14442,7 +14489,8 @@ const redirectsCompatibilityTableData = {
14442
14489
  deprecationMessage: null,
14443
14490
  removed: false,
14444
14491
  removalMessage: null,
14445
- isBlocking: false
14492
+ isBlocking: false,
14493
+ resourceTypes: []
14446
14494
  }, {
14447
14495
  name: "google-analytics_analytics.js",
14448
14496
  aliases: null,
@@ -14454,7 +14502,8 @@ const redirectsCompatibilityTableData = {
14454
14502
  deprecationMessage: null,
14455
14503
  removed: false,
14456
14504
  removalMessage: null,
14457
- isBlocking: false
14505
+ isBlocking: false,
14506
+ resourceTypes: ["script"]
14458
14507
  }],
14459
14508
  map: {
14460
14509
  "1": 0,
@@ -14481,7 +14530,8 @@ const redirectsCompatibilityTableData = {
14481
14530
  deprecationMessage: null,
14482
14531
  removed: false,
14483
14532
  removalMessage: null,
14484
- isBlocking: false
14533
+ isBlocking: false,
14534
+ resourceTypes: ["script"]
14485
14535
  }],
14486
14536
  map: {
14487
14537
  "1024": 0,
@@ -14501,7 +14551,8 @@ const redirectsCompatibilityTableData = {
14501
14551
  deprecationMessage: null,
14502
14552
  removed: false,
14503
14553
  removalMessage: null,
14504
- isBlocking: false
14554
+ isBlocking: false,
14555
+ resourceTypes: ["script"]
14505
14556
  }],
14506
14557
  map: {
14507
14558
  "1024": 0,
@@ -14521,7 +14572,8 @@ const redirectsCompatibilityTableData = {
14521
14572
  deprecationMessage: null,
14522
14573
  removed: false,
14523
14574
  removalMessage: null,
14524
- isBlocking: false
14575
+ isBlocking: false,
14576
+ resourceTypes: []
14525
14577
  }, {
14526
14578
  name: "google-ima.js",
14527
14579
  aliases: null,
@@ -14533,7 +14585,8 @@ const redirectsCompatibilityTableData = {
14533
14585
  deprecationMessage: null,
14534
14586
  removed: false,
14535
14587
  removalMessage: null,
14536
- isBlocking: false
14588
+ isBlocking: false,
14589
+ resourceTypes: ["script"]
14537
14590
  }],
14538
14591
  map: {
14539
14592
  "1": 0,
@@ -14551,7 +14604,7 @@ const redirectsCompatibilityTableData = {
14551
14604
  }, {
14552
14605
  shared: [{
14553
14606
  name: "googlesyndication-adsbygoogle",
14554
- aliases: ["ubo-googlesyndication_adsbygoogle.js", "googlesyndication_adsbygoogle.js"],
14607
+ aliases: ["ubo-googlesyndication_adsbygoogle.js", "ubo-googlesyndication.com/adsbygoogle.js", "googlesyndication_adsbygoogle.js"],
14555
14608
  description: "Mocks Google AdSense API.",
14556
14609
  docs: null,
14557
14610
  versionAdded: null,
@@ -14560,10 +14613,11 @@ const redirectsCompatibilityTableData = {
14560
14613
  deprecationMessage: null,
14561
14614
  removed: false,
14562
14615
  removalMessage: null,
14563
- isBlocking: false
14616
+ isBlocking: false,
14617
+ resourceTypes: []
14564
14618
  }, {
14565
14619
  name: "googlesyndication_adsbygoogle.js",
14566
- aliases: null,
14620
+ aliases: ["googlesyndication.com/adsbygoogle.js"],
14567
14621
  description: "Mocks Google AdSense API.",
14568
14622
  docs: null,
14569
14623
  versionAdded: null,
@@ -14572,7 +14626,8 @@ const redirectsCompatibilityTableData = {
14572
14626
  deprecationMessage: null,
14573
14627
  removed: false,
14574
14628
  removalMessage: null,
14575
- isBlocking: false
14629
+ isBlocking: false,
14630
+ resourceTypes: ["script"]
14576
14631
  }],
14577
14632
  map: {
14578
14633
  "1": 0,
@@ -14599,7 +14654,8 @@ const redirectsCompatibilityTableData = {
14599
14654
  deprecationMessage: null,
14600
14655
  removed: false,
14601
14656
  removalMessage: null,
14602
- isBlocking: false
14657
+ isBlocking: false,
14658
+ resourceTypes: []
14603
14659
  }, {
14604
14660
  name: "googletagservices_gpt.js",
14605
14661
  aliases: null,
@@ -14611,7 +14667,8 @@ const redirectsCompatibilityTableData = {
14611
14667
  deprecationMessage: null,
14612
14668
  removed: false,
14613
14669
  removalMessage: null,
14614
- isBlocking: false
14670
+ isBlocking: false,
14671
+ resourceTypes: ["script"]
14615
14672
  }],
14616
14673
  map: {
14617
14674
  "1": 0,
@@ -14638,7 +14695,8 @@ const redirectsCompatibilityTableData = {
14638
14695
  deprecationMessage: null,
14639
14696
  removed: false,
14640
14697
  removalMessage: null,
14641
- isBlocking: false
14698
+ isBlocking: false,
14699
+ resourceTypes: ["script"]
14642
14700
  }],
14643
14701
  map: {
14644
14702
  "1024": 0,
@@ -14658,7 +14716,8 @@ const redirectsCompatibilityTableData = {
14658
14716
  deprecationMessage: null,
14659
14717
  removed: false,
14660
14718
  removalMessage: null,
14661
- isBlocking: false
14719
+ isBlocking: false,
14720
+ resourceTypes: []
14662
14721
  }],
14663
14722
  map: {
14664
14723
  "1": 0,
@@ -14681,7 +14740,8 @@ const redirectsCompatibilityTableData = {
14681
14740
  deprecationMessage: null,
14682
14741
  removed: false,
14683
14742
  removalMessage: null,
14684
- isBlocking: false
14743
+ isBlocking: false,
14744
+ resourceTypes: []
14685
14745
  }],
14686
14746
  map: {
14687
14747
  "1": 0,
@@ -14704,7 +14764,8 @@ const redirectsCompatibilityTableData = {
14704
14764
  deprecationMessage: null,
14705
14765
  removed: false,
14706
14766
  removalMessage: null,
14707
- isBlocking: false
14767
+ isBlocking: false,
14768
+ resourceTypes: []
14708
14769
  }],
14709
14770
  map: {
14710
14771
  "1": 0,
@@ -14727,7 +14788,8 @@ const redirectsCompatibilityTableData = {
14727
14788
  deprecationMessage: null,
14728
14789
  removed: false,
14729
14790
  removalMessage: null,
14730
- isBlocking: false
14791
+ isBlocking: false,
14792
+ resourceTypes: []
14731
14793
  }],
14732
14794
  map: {
14733
14795
  "1": 0,
@@ -14750,7 +14812,8 @@ const redirectsCompatibilityTableData = {
14750
14812
  deprecationMessage: null,
14751
14813
  removed: false,
14752
14814
  removalMessage: null,
14753
- isBlocking: false
14815
+ isBlocking: false,
14816
+ resourceTypes: []
14754
14817
  }],
14755
14818
  map: {
14756
14819
  "1": 0,
@@ -14773,7 +14836,8 @@ const redirectsCompatibilityTableData = {
14773
14836
  deprecationMessage: null,
14774
14837
  removed: false,
14775
14838
  removalMessage: null,
14776
- isBlocking: false
14839
+ isBlocking: false,
14840
+ resourceTypes: []
14777
14841
  }],
14778
14842
  map: {
14779
14843
  "1": 0,
@@ -14796,7 +14860,8 @@ const redirectsCompatibilityTableData = {
14796
14860
  deprecationMessage: null,
14797
14861
  removed: false,
14798
14862
  removalMessage: null,
14799
- isBlocking: false
14863
+ isBlocking: false,
14864
+ resourceTypes: []
14800
14865
  }, {
14801
14866
  name: "noeval.js",
14802
14867
  aliases: null,
@@ -14808,7 +14873,8 @@ const redirectsCompatibilityTableData = {
14808
14873
  deprecationMessage: null,
14809
14874
  removed: false,
14810
14875
  removalMessage: null,
14811
- isBlocking: false
14876
+ isBlocking: false,
14877
+ resourceTypes: ["script"]
14812
14878
  }],
14813
14879
  map: {
14814
14880
  "1": 0,
@@ -14835,7 +14901,8 @@ const redirectsCompatibilityTableData = {
14835
14901
  deprecationMessage: null,
14836
14902
  removed: false,
14837
14903
  removalMessage: null,
14838
- isBlocking: false
14904
+ isBlocking: false,
14905
+ resourceTypes: ["media"]
14839
14906
  }],
14840
14907
  map: {
14841
14908
  "1024": 0,
@@ -14855,7 +14922,8 @@ const redirectsCompatibilityTableData = {
14855
14922
  deprecationMessage: null,
14856
14923
  removed: false,
14857
14924
  removalMessage: null,
14858
- isBlocking: false
14925
+ isBlocking: false,
14926
+ resourceTypes: []
14859
14927
  }, {
14860
14928
  name: "noop.css",
14861
14929
  aliases: null,
@@ -14867,7 +14935,8 @@ const redirectsCompatibilityTableData = {
14867
14935
  deprecationMessage: null,
14868
14936
  removed: false,
14869
14937
  removalMessage: null,
14870
- isBlocking: false
14938
+ isBlocking: false,
14939
+ resourceTypes: ["stylesheet"]
14871
14940
  }, {
14872
14941
  name: "blank-css",
14873
14942
  aliases: null,
@@ -14879,7 +14948,8 @@ const redirectsCompatibilityTableData = {
14879
14948
  deprecationMessage: null,
14880
14949
  removed: false,
14881
14950
  removalMessage: null,
14882
- isBlocking: false
14951
+ isBlocking: false,
14952
+ resourceTypes: []
14883
14953
  }],
14884
14954
  map: {
14885
14955
  "1": 0,
@@ -14910,7 +14980,8 @@ const redirectsCompatibilityTableData = {
14910
14980
  deprecationMessage: null,
14911
14981
  removed: false,
14912
14982
  removalMessage: null,
14913
- isBlocking: false
14983
+ isBlocking: false,
14984
+ resourceTypes: []
14914
14985
  }, {
14915
14986
  name: "noop.html",
14916
14987
  aliases: null,
@@ -14922,7 +14993,8 @@ const redirectsCompatibilityTableData = {
14922
14993
  deprecationMessage: null,
14923
14994
  removed: false,
14924
14995
  removalMessage: null,
14925
- isBlocking: false
14996
+ isBlocking: false,
14997
+ resourceTypes: ["sub_frame"]
14926
14998
  }, {
14927
14999
  name: "blank-html",
14928
15000
  aliases: null,
@@ -14934,7 +15006,8 @@ const redirectsCompatibilityTableData = {
14934
15006
  deprecationMessage: null,
14935
15007
  removed: false,
14936
15008
  removalMessage: null,
14937
- isBlocking: false
15009
+ isBlocking: false,
15010
+ resourceTypes: []
14938
15011
  }],
14939
15012
  map: {
14940
15013
  "1": 0,
@@ -14965,7 +15038,8 @@ const redirectsCompatibilityTableData = {
14965
15038
  deprecationMessage: null,
14966
15039
  removed: false,
14967
15040
  removalMessage: null,
14968
- isBlocking: false
15041
+ isBlocking: false,
15042
+ resourceTypes: []
14969
15043
  }, {
14970
15044
  name: "noop.js",
14971
15045
  aliases: null,
@@ -14977,7 +15051,8 @@ const redirectsCompatibilityTableData = {
14977
15051
  deprecationMessage: null,
14978
15052
  removed: false,
14979
15053
  removalMessage: null,
14980
- isBlocking: false
15054
+ isBlocking: false,
15055
+ resourceTypes: ["script"]
14981
15056
  }, {
14982
15057
  name: "blank-js",
14983
15058
  aliases: null,
@@ -14989,7 +15064,8 @@ const redirectsCompatibilityTableData = {
14989
15064
  deprecationMessage: null,
14990
15065
  removed: false,
14991
15066
  removalMessage: null,
14992
- isBlocking: false
15067
+ isBlocking: false,
15068
+ resourceTypes: []
14993
15069
  }],
14994
15070
  map: {
14995
15071
  "1": 0,
@@ -15020,7 +15096,8 @@ const redirectsCompatibilityTableData = {
15020
15096
  deprecationMessage: null,
15021
15097
  removed: false,
15022
15098
  removalMessage: null,
15023
- isBlocking: false
15099
+ isBlocking: false,
15100
+ resourceTypes: []
15024
15101
  }, {
15025
15102
  name: "noop.json",
15026
15103
  aliases: null,
@@ -15032,7 +15109,8 @@ const redirectsCompatibilityTableData = {
15032
15109
  deprecationMessage: null,
15033
15110
  removed: false,
15034
15111
  removalMessage: null,
15035
- isBlocking: false
15112
+ isBlocking: false,
15113
+ resourceTypes: []
15036
15114
  }],
15037
15115
  map: {
15038
15116
  "1": 0,
@@ -15059,7 +15137,8 @@ const redirectsCompatibilityTableData = {
15059
15137
  deprecationMessage: null,
15060
15138
  removed: false,
15061
15139
  removalMessage: null,
15062
- isBlocking: false
15140
+ isBlocking: false,
15141
+ resourceTypes: []
15063
15142
  }, {
15064
15143
  name: "noop-0.1s.mp3",
15065
15144
  aliases: null,
@@ -15071,7 +15150,8 @@ const redirectsCompatibilityTableData = {
15071
15150
  deprecationMessage: null,
15072
15151
  removed: false,
15073
15152
  removalMessage: null,
15074
- isBlocking: false
15153
+ isBlocking: false,
15154
+ resourceTypes: ["media"]
15075
15155
  }, {
15076
15156
  name: "blank-mp3",
15077
15157
  aliases: null,
@@ -15083,7 +15163,8 @@ const redirectsCompatibilityTableData = {
15083
15163
  deprecationMessage: null,
15084
15164
  removed: false,
15085
15165
  removalMessage: null,
15086
- isBlocking: false
15166
+ isBlocking: false,
15167
+ resourceTypes: []
15087
15168
  }],
15088
15169
  map: {
15089
15170
  "1": 0,
@@ -15114,7 +15195,8 @@ const redirectsCompatibilityTableData = {
15114
15195
  deprecationMessage: null,
15115
15196
  removed: false,
15116
15197
  removalMessage: null,
15117
- isBlocking: false
15198
+ isBlocking: false,
15199
+ resourceTypes: []
15118
15200
  }, {
15119
15201
  name: "noop-1s.mp4",
15120
15202
  aliases: null,
@@ -15126,7 +15208,8 @@ const redirectsCompatibilityTableData = {
15126
15208
  deprecationMessage: null,
15127
15209
  removed: false,
15128
15210
  removalMessage: null,
15129
- isBlocking: false
15211
+ isBlocking: false,
15212
+ resourceTypes: ["media"]
15130
15213
  }, {
15131
15214
  name: "blank-mp4",
15132
15215
  aliases: null,
@@ -15138,7 +15221,8 @@ const redirectsCompatibilityTableData = {
15138
15221
  deprecationMessage: null,
15139
15222
  removed: false,
15140
15223
  removalMessage: null,
15141
- isBlocking: false
15224
+ isBlocking: false,
15225
+ resourceTypes: []
15142
15226
  }],
15143
15227
  map: {
15144
15228
  "1": 0,
@@ -15169,7 +15253,8 @@ const redirectsCompatibilityTableData = {
15169
15253
  deprecationMessage: null,
15170
15254
  removed: false,
15171
15255
  removalMessage: null,
15172
- isBlocking: false
15256
+ isBlocking: false,
15257
+ resourceTypes: []
15173
15258
  }, {
15174
15259
  name: "noop.txt",
15175
15260
  aliases: null,
@@ -15181,7 +15266,8 @@ const redirectsCompatibilityTableData = {
15181
15266
  deprecationMessage: null,
15182
15267
  removed: false,
15183
15268
  removalMessage: null,
15184
- isBlocking: false
15269
+ isBlocking: false,
15270
+ resourceTypes: ["image", "media", "sub_frame", "stylesheet", "script", "xmlhttprequest", "other"]
15185
15271
  }, {
15186
15272
  name: "blank-text",
15187
15273
  aliases: null,
@@ -15193,7 +15279,8 @@ const redirectsCompatibilityTableData = {
15193
15279
  deprecationMessage: null,
15194
15280
  removed: false,
15195
15281
  removalMessage: null,
15196
- isBlocking: false
15282
+ isBlocking: false,
15283
+ resourceTypes: []
15197
15284
  }],
15198
15285
  map: {
15199
15286
  "1": 0,
@@ -15224,7 +15311,8 @@ const redirectsCompatibilityTableData = {
15224
15311
  deprecationMessage: null,
15225
15312
  removed: false,
15226
15313
  removalMessage: null,
15227
- isBlocking: false
15314
+ isBlocking: false,
15315
+ resourceTypes: []
15228
15316
  }],
15229
15317
  map: {
15230
15318
  "1": 0,
@@ -15247,7 +15335,8 @@ const redirectsCompatibilityTableData = {
15247
15335
  deprecationMessage: null,
15248
15336
  removed: false,
15249
15337
  removalMessage: null,
15250
- isBlocking: false
15338
+ isBlocking: false,
15339
+ resourceTypes: []
15251
15340
  }],
15252
15341
  map: {
15253
15342
  "1": 0,
@@ -15270,7 +15359,8 @@ const redirectsCompatibilityTableData = {
15270
15359
  deprecationMessage: null,
15271
15360
  removed: false,
15272
15361
  removalMessage: null,
15273
- isBlocking: false
15362
+ isBlocking: false,
15363
+ resourceTypes: []
15274
15364
  }],
15275
15365
  map: {
15276
15366
  "1": 0,
@@ -15293,7 +15383,8 @@ const redirectsCompatibilityTableData = {
15293
15383
  deprecationMessage: null,
15294
15384
  removed: false,
15295
15385
  removalMessage: null,
15296
- isBlocking: false
15386
+ isBlocking: false,
15387
+ resourceTypes: []
15297
15388
  }, {
15298
15389
  name: "noop-vmap1.0.xml",
15299
15390
  aliases: null,
@@ -15305,7 +15396,8 @@ const redirectsCompatibilityTableData = {
15305
15396
  deprecationMessage: null,
15306
15397
  removed: false,
15307
15398
  removalMessage: null,
15308
- isBlocking: false
15399
+ isBlocking: false,
15400
+ resourceTypes: ["media"]
15309
15401
  }],
15310
15402
  map: {
15311
15403
  "1": 0,
@@ -15332,7 +15424,8 @@ const redirectsCompatibilityTableData = {
15332
15424
  deprecationMessage: null,
15333
15425
  removed: false,
15334
15426
  removalMessage: null,
15335
- isBlocking: false
15427
+ isBlocking: false,
15428
+ resourceTypes: []
15336
15429
  }, {
15337
15430
  name: "nowebrtc.js",
15338
15431
  aliases: null,
@@ -15344,7 +15437,8 @@ const redirectsCompatibilityTableData = {
15344
15437
  deprecationMessage: null,
15345
15438
  removed: false,
15346
15439
  removalMessage: null,
15347
- isBlocking: false
15440
+ isBlocking: false,
15441
+ resourceTypes: ["other"]
15348
15442
  }],
15349
15443
  map: {
15350
15444
  "1": 0,
@@ -15371,7 +15465,8 @@ const redirectsCompatibilityTableData = {
15371
15465
  deprecationMessage: null,
15372
15466
  removed: false,
15373
15467
  removalMessage: null,
15374
- isBlocking: false
15468
+ isBlocking: false,
15469
+ resourceTypes: ["script"]
15375
15470
  }],
15376
15471
  map: {
15377
15472
  "1024": 0,
@@ -15391,7 +15486,8 @@ const redirectsCompatibilityTableData = {
15391
15486
  deprecationMessage: null,
15392
15487
  removed: false,
15393
15488
  removalMessage: null,
15394
- isBlocking: false
15489
+ isBlocking: false,
15490
+ resourceTypes: []
15395
15491
  }],
15396
15492
  map: {
15397
15493
  "1": 0,
@@ -15414,7 +15510,8 @@ const redirectsCompatibilityTableData = {
15414
15510
  deprecationMessage: null,
15415
15511
  removed: false,
15416
15512
  removalMessage: null,
15417
- isBlocking: false
15513
+ isBlocking: false,
15514
+ resourceTypes: []
15418
15515
  }, {
15419
15516
  name: "prebid-ads.js",
15420
15517
  aliases: null,
@@ -15426,7 +15523,8 @@ const redirectsCompatibilityTableData = {
15426
15523
  deprecationMessage: null,
15427
15524
  removed: false,
15428
15525
  removalMessage: null,
15429
- isBlocking: false
15526
+ isBlocking: false,
15527
+ resourceTypes: ["script"]
15430
15528
  }],
15431
15529
  map: {
15432
15530
  "1": 0,
@@ -15453,7 +15551,8 @@ const redirectsCompatibilityTableData = {
15453
15551
  deprecationMessage: null,
15454
15552
  removed: false,
15455
15553
  removalMessage: null,
15456
- isBlocking: false
15554
+ isBlocking: false,
15555
+ resourceTypes: []
15457
15556
  }],
15458
15557
  map: {
15459
15558
  "1": 0,
@@ -15476,7 +15575,8 @@ const redirectsCompatibilityTableData = {
15476
15575
  deprecationMessage: null,
15477
15576
  removed: false,
15478
15577
  removalMessage: null,
15479
- isBlocking: false
15578
+ isBlocking: false,
15579
+ resourceTypes: []
15480
15580
  }, {
15481
15581
  name: "nobab.js",
15482
15582
  aliases: null,
@@ -15488,7 +15588,8 @@ const redirectsCompatibilityTableData = {
15488
15588
  deprecationMessage: null,
15489
15589
  removed: false,
15490
15590
  removalMessage: null,
15491
- isBlocking: false
15591
+ isBlocking: false,
15592
+ resourceTypes: ["script"]
15492
15593
  }],
15493
15594
  map: {
15494
15595
  "1": 0,
@@ -15515,7 +15616,8 @@ const redirectsCompatibilityTableData = {
15515
15616
  deprecationMessage: null,
15516
15617
  removed: false,
15517
15618
  removalMessage: null,
15518
- isBlocking: false
15619
+ isBlocking: false,
15620
+ resourceTypes: []
15519
15621
  }, {
15520
15622
  name: "nobab2.js",
15521
15623
  aliases: null,
@@ -15527,7 +15629,8 @@ const redirectsCompatibilityTableData = {
15527
15629
  deprecationMessage: null,
15528
15630
  removed: false,
15529
15631
  removalMessage: null,
15530
- isBlocking: false
15632
+ isBlocking: false,
15633
+ resourceTypes: ["script"]
15531
15634
  }],
15532
15635
  map: {
15533
15636
  "1": 0,
@@ -15554,10 +15657,11 @@ const redirectsCompatibilityTableData = {
15554
15657
  deprecationMessage: null,
15555
15658
  removed: false,
15556
15659
  removalMessage: null,
15557
- isBlocking: false
15660
+ isBlocking: false,
15661
+ resourceTypes: []
15558
15662
  }, {
15559
15663
  name: "nofab.js",
15560
- aliases: null,
15664
+ aliases: ["fuckadblock.js-3.2.0", "fuckadblock.js-3.2.0.js"],
15561
15665
  description: "Mocks FAB script v3.2.0.",
15562
15666
  docs: null,
15563
15667
  versionAdded: null,
@@ -15566,7 +15670,8 @@ const redirectsCompatibilityTableData = {
15566
15670
  deprecationMessage: null,
15567
15671
  removed: false,
15568
15672
  removalMessage: null,
15569
- isBlocking: false
15673
+ isBlocking: false,
15674
+ resourceTypes: ["script"]
15570
15675
  }],
15571
15676
  map: {
15572
15677
  "1": 0,
@@ -15593,7 +15698,8 @@ const redirectsCompatibilityTableData = {
15593
15698
  deprecationMessage: null,
15594
15699
  removed: false,
15595
15700
  removalMessage: null,
15596
- isBlocking: false
15701
+ isBlocking: false,
15702
+ resourceTypes: []
15597
15703
  }, {
15598
15704
  name: "popads.js",
15599
15705
  aliases: null,
@@ -15605,7 +15711,8 @@ const redirectsCompatibilityTableData = {
15605
15711
  deprecationMessage: null,
15606
15712
  removed: false,
15607
15713
  removalMessage: null,
15608
- isBlocking: false
15714
+ isBlocking: false,
15715
+ resourceTypes: ["script"]
15609
15716
  }],
15610
15717
  map: {
15611
15718
  "1": 0,
@@ -15632,7 +15739,8 @@ const redirectsCompatibilityTableData = {
15632
15739
  deprecationMessage: null,
15633
15740
  removed: false,
15634
15741
  removalMessage: null,
15635
- isBlocking: false
15742
+ isBlocking: false,
15743
+ resourceTypes: []
15636
15744
  }, {
15637
15745
  name: "scorecardresearch_beacon.js",
15638
15746
  aliases: null,
@@ -15644,7 +15752,8 @@ const redirectsCompatibilityTableData = {
15644
15752
  deprecationMessage: null,
15645
15753
  removed: false,
15646
15754
  removalMessage: null,
15647
- isBlocking: false
15755
+ isBlocking: false,
15756
+ resourceTypes: ["script"]
15648
15757
  }],
15649
15758
  map: {
15650
15759
  "1": 0,
@@ -15671,7 +15780,8 @@ const redirectsCompatibilityTableData = {
15671
15780
  deprecationMessage: null,
15672
15781
  removed: false,
15673
15782
  removalMessage: null,
15674
- isBlocking: false
15783
+ isBlocking: false,
15784
+ resourceTypes: []
15675
15785
  }, {
15676
15786
  name: "popads-dummy.js",
15677
15787
  aliases: null,
@@ -15683,7 +15793,8 @@ const redirectsCompatibilityTableData = {
15683
15793
  deprecationMessage: null,
15684
15794
  removed: false,
15685
15795
  removalMessage: null,
15686
- isBlocking: false
15796
+ isBlocking: false,
15797
+ resourceTypes: ["script"]
15687
15798
  }],
15688
15799
  map: {
15689
15800
  "1": 0,
@@ -15744,7 +15855,9 @@ const redirectsCompatibilityTableData = {
15744
15855
  "google-ima.js": 19,
15745
15856
  "googlesyndication-adsbygoogle": 20,
15746
15857
  "ubo-googlesyndication_adsbygoogle.js": 20,
15858
+ "ubo-googlesyndication.com/adsbygoogle.js": 20,
15747
15859
  "googlesyndication_adsbygoogle.js": 20,
15860
+ "googlesyndication.com/adsbygoogle.js": 20,
15748
15861
  "googletagservices-gpt": 21,
15749
15862
  "ubo-googletagservices_gpt.js": 21,
15750
15863
  "googletagservices_gpt.js": 21,
@@ -15803,6 +15916,8 @@ const redirectsCompatibilityTableData = {
15803
15916
  "nobab2.js": 48,
15804
15917
  "prevent-fab-3.2.0": 49,
15805
15918
  "nofab.js": 49,
15919
+ "fuckadblock.js-3.2.0": 49,
15920
+ "fuckadblock.js-3.2.0.js": 49,
15806
15921
  "prevent-popads-net": 50,
15807
15922
  "popads.js": 50,
15808
15923
  "scorecardresearch-beacon": 51,
@@ -18510,7 +18625,7 @@ const scriptletsCompatibilityTableData = {
18510
18625
  }]
18511
18626
  }, {
18512
18627
  name: "remove-attr.js",
18513
- aliases: ["ra.js"],
18628
+ aliases: ["ra.js", "ra", "remove-attr"],
18514
18629
  description: null,
18515
18630
  docs: "https://github.com/gorhill/uBlock/wiki/Resources-Library#remove-attrjs-",
18516
18631
  versionAdded: null,
@@ -18591,7 +18706,7 @@ const scriptletsCompatibilityTableData = {
18591
18706
  }]
18592
18707
  }, {
18593
18708
  name: "remove-class.js",
18594
- aliases: ["rc.js"],
18709
+ aliases: ["rc.js", "rc", "remove-class"],
18595
18710
  description: null,
18596
18711
  docs: "https://github.com/gorhill/uBlock/wiki/Resources-Library#remove-classjs-",
18597
18712
  versionAdded: null,
@@ -20448,6 +20563,7 @@ const scriptletsCompatibilityTableData = {
20448
20563
  "ubo-ra.js": 59,
20449
20564
  "ubo-remove-attr": 59,
20450
20565
  "ubo-ra": 59,
20566
+ ra: 59,
20451
20567
  "remove-class": 60,
20452
20568
  "remove-class.js": 60,
20453
20569
  "ubo-remove-class.js": 60,
@@ -20455,6 +20571,7 @@ const scriptletsCompatibilityTableData = {
20455
20571
  "ubo-rc.js": 60,
20456
20572
  "ubo-remove-class": 60,
20457
20573
  "ubo-rc": 60,
20574
+ rc: 60,
20458
20575
  "remove-cookie": 61,
20459
20576
  "cookie-remover.js": 61,
20460
20577
  "ubo-cookie-remover.js": 61,
@@ -21521,8 +21638,22 @@ function getScriptletName(scriptletNode) {
21521
21638
  */
21522
21639
  function transformNthScriptletArgument(scriptletNode, index, transform) {
21523
21640
  const child = scriptletNode.children[index];
21524
- if (!isUndefined(child) && !isNull(child)) {
21525
- child.value = transform(child.value);
21641
+ if (!isUndefined(child)) {
21642
+ const transformed = transform(child?.value ?? null);
21643
+ if (isNull(transformed)) {
21644
+ // eslint-disable-next-line no-param-reassign
21645
+ scriptletNode.children[index] = null;
21646
+ return;
21647
+ }
21648
+ if (isNull(child)) {
21649
+ // eslint-disable-next-line no-param-reassign
21650
+ scriptletNode.children[index] = {
21651
+ type: 'Value',
21652
+ value: transformed
21653
+ };
21654
+ return;
21655
+ }
21656
+ child.value = transformed;
21526
21657
  }
21527
21658
  }
21528
21659
  /**
@@ -21553,9 +21684,89 @@ function setScriptletName(scriptletNode, name) {
21553
21684
  * @param quoteType Preferred quote type
21554
21685
  */
21555
21686
  function setScriptletQuoteType(scriptletNode, quoteType) {
21556
- transformAllScriptletArguments(scriptletNode, value => QuoteUtils.setStringQuoteType(value, quoteType));
21687
+ // null is a special value that means "no value", but we can't change its quote type,
21688
+ // so we need to convert it to empty string
21689
+ transformAllScriptletArguments(scriptletNode, value => QuoteUtils.setStringQuoteType(value ?? EMPTY, quoteType));
21557
21690
  }
21558
21691
 
21692
+ /**
21693
+ * @file Resource type schema.
21694
+ */
21695
+ /**
21696
+ * Resource type.
21697
+ *
21698
+ * @see {@link https://developer.chrome.com/docs/extensions/reference/declarativeNetRequest/#type-ResourceType}
21699
+ */
21700
+ var ResourceType;
21701
+ (function (ResourceType) {
21702
+ ResourceType["MainFrame"] = "main_frame";
21703
+ ResourceType["SubFrame"] = "sub_frame";
21704
+ ResourceType["Stylesheet"] = "stylesheet";
21705
+ ResourceType["Script"] = "script";
21706
+ ResourceType["Image"] = "image";
21707
+ ResourceType["Font"] = "font";
21708
+ ResourceType["Object"] = "object";
21709
+ ResourceType["XmlHttpRequest"] = "xmlhttprequest";
21710
+ ResourceType["Ping"] = "ping";
21711
+ ResourceType["Media"] = "media";
21712
+ ResourceType["WebSocket"] = "websocket";
21713
+ ResourceType["Other"] = "other";
21714
+ })(ResourceType || (ResourceType = {}));
21715
+ /**
21716
+ * Resource type schema.
21717
+ */
21718
+ const resourceTypeSchema = zod.nativeEnum(ResourceType);
21719
+
21720
+ /**
21721
+ * Map of resource types to their corresponding adblock modifier names.
21722
+ *
21723
+ * @note Record type is used to ensure that all resource types are present in the map.
21724
+ */
21725
+ const RESOURCE_TYPE_MODIFIER_MAP = Object.freeze({
21726
+ [ResourceType.MainFrame]: 'document',
21727
+ [ResourceType.SubFrame]: 'subdocument',
21728
+ [ResourceType.Stylesheet]: 'stylesheet',
21729
+ [ResourceType.Script]: 'script',
21730
+ [ResourceType.Image]: 'image',
21731
+ [ResourceType.Font]: 'font',
21732
+ [ResourceType.Object]: 'object',
21733
+ [ResourceType.XmlHttpRequest]: 'xmlhttprequest',
21734
+ [ResourceType.Ping]: 'ping',
21735
+ [ResourceType.Media]: 'media',
21736
+ [ResourceType.WebSocket]: 'websocket',
21737
+ [ResourceType.Other]: 'other'
21738
+ });
21739
+ /**
21740
+ * Gets the adblock modifier name for the given resource type.
21741
+ *
21742
+ * @param resourceType Resource type to get the modifier name for.
21743
+ * @param platform Platform to get the modifier for.
21744
+ *
21745
+ * @returns A string containing the adblock modifier name for the given resource type
21746
+ * or `null` if the modifier could not be found.
21747
+ */
21748
+ const getResourceTypeModifier = (resourceType, platform) => {
21749
+ const modifierName = RESOURCE_TYPE_MODIFIER_MAP[resourceType];
21750
+ if (!modifierName) {
21751
+ return null;
21752
+ }
21753
+ const modifierData = modifiersCompatibilityTable.getFirst(modifierName, platform);
21754
+ if (isNull(modifierData)) {
21755
+ return null;
21756
+ }
21757
+ return modifierData.name;
21758
+ };
21759
+ /**
21760
+ * Checks if the given resource type is valid.
21761
+ *
21762
+ * @param resourceType Resource type to check.
21763
+ *
21764
+ * @returns `true` if the resource type is valid, `false` otherwise.
21765
+ */
21766
+ const isValidResourceType = resourceType => {
21767
+ return Object.values(ResourceType).includes(resourceType);
21768
+ };
21769
+
21559
21770
  /**
21560
21771
  * @file Compatibility tables for redirects.
21561
21772
  */
@@ -21565,19 +21776,29 @@ function setScriptletQuoteType(scriptletNode, quoteType) {
21565
21776
  const ABP_RESOURCE_PREFIX = 'abp-resource:';
21566
21777
  const ABP_RESOURCE_PREFIX_LENGTH = ABP_RESOURCE_PREFIX.length;
21567
21778
  /**
21568
- * Transforms the name of an ABP redirect to a normalized form.
21779
+ * Normalizes the redirect name.
21569
21780
  *
21570
21781
  * @param name Redirect name to normalize.
21571
21782
  *
21572
21783
  * @returns Normalized redirect name.
21573
21784
  *
21574
21785
  * @example
21575
- * abpRedirectNameNormalizer('abp-resource:my-resource') // => 'my-resource'
21786
+ * redirectNameNormalizer('abp-resource:my-resource') // => 'my-resource'
21787
+ * redirectNameNormalizer('noop.js:99') // => 'noop.js'
21576
21788
  */
21577
- const abpRedirectNameNormalizer = name => {
21789
+ const redirectNameNormalizer = name => {
21790
+ // Remove ABP resource prefix, if present
21578
21791
  if (name.startsWith(ABP_RESOURCE_PREFIX)) {
21579
21792
  return name.slice(ABP_RESOURCE_PREFIX_LENGTH);
21580
21793
  }
21794
+ // Remove :[integer] priority suffix from the name, if present
21795
+ // See:
21796
+ // - https://github.com/AdguardTeam/tsurlfilter/issues/59
21797
+ // - https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#redirect
21798
+ const colonIndex = name.lastIndexOf(COLON);
21799
+ if (colonIndex !== -1 && /^\d+$/.test(name.slice(colonIndex + 1))) {
21800
+ return name.slice(0, colonIndex);
21801
+ }
21581
21802
  return name;
21582
21803
  };
21583
21804
  /**
@@ -21590,7 +21811,36 @@ class RedirectsCompatibilityTable extends CompatibilityTableBase {
21590
21811
  * @param data Compatibility table data.
21591
21812
  */
21592
21813
  constructor(data) {
21593
- super(data, abpRedirectNameNormalizer);
21814
+ super(data, redirectNameNormalizer);
21815
+ }
21816
+ /**
21817
+ * Gets the resource type adblock modifiers for the redirect for the given platform
21818
+ * based on the `resourceTypes` field.
21819
+ *
21820
+ * @param redirect Redirect name or redirect data.
21821
+ * @param platform Platform to get the modifiers for.
21822
+ *
21823
+ * @returns Set of resource type modifiers or an empty set if the redirect is not found or has no resource types.
21824
+ */
21825
+ getResourceTypeModifiers(redirect, platform) {
21826
+ let redirectData = null;
21827
+ if (isString(redirect)) {
21828
+ redirectData = this.getFirst(redirect, platform);
21829
+ } else {
21830
+ redirectData = redirect;
21831
+ }
21832
+ const modifierNames = new Set();
21833
+ if (isNull(redirectData) || isUndefined(redirectData.resourceTypes)) {
21834
+ return modifierNames;
21835
+ }
21836
+ for (const resourceType of redirectData.resourceTypes) {
21837
+ const modifierName = getResourceTypeModifier(resourceType, platform);
21838
+ if (isNull(modifierName)) {
21839
+ continue;
21840
+ }
21841
+ modifierNames.add(modifierName);
21842
+ }
21843
+ return modifierNames;
21594
21844
  }
21595
21845
  }
21596
21846
  /**
@@ -22225,7 +22475,13 @@ zodToCamelCase(baseCompatibilityDataSchema.extend({
22225
22475
  /**
22226
22476
  * Whether the redirect is blocking.
22227
22477
  */
22228
- is_blocking: booleanSchema.default(false)
22478
+ is_blocking: booleanSchema.default(false),
22479
+ /**
22480
+ * Resource type(s) belonging to the redirect.
22481
+ *
22482
+ * @see {@link https://developer.chrome.com/docs/extensions/reference/declarativeNetRequest/#type-ResourceType}
22483
+ */
22484
+ resource_types: zod.array(resourceTypeSchema).default([])
22229
22485
  }).superRefine(baseRefineLogic));
22230
22486
 
22231
22487
  /**
@@ -22318,11 +22574,14 @@ const ADG_PREVENT_FETCH_NAME = 'prevent-fetch';
22318
22574
  const ADG_PREVENT_FETCH_EMPTY_STRING = '';
22319
22575
  const ADG_PREVENT_FETCH_WILDCARD = '*';
22320
22576
  const UBO_NO_FETCH_IF_WILDCARD = '/^/';
22577
+ const UBO_REMOVE_CLASS_NAME = 'remove-class.js';
22578
+ const UBO_REMOVE_ATTR_NAME = 'remove-attr.js';
22321
22579
  const setConstantAdgToUboMap = {
22322
22580
  [ADG_SET_CONSTANT_EMPTY_STRING]: UBO_SET_CONSTANT_EMPTY_STRING,
22323
22581
  [ADG_SET_CONSTANT_EMPTY_ARRAY]: UBO_SET_CONSTANT_EMPTY_ARRAY,
22324
22582
  [ADG_SET_CONSTANT_EMPTY_OBJECT]: UBO_SET_CONSTANT_EMPTY_OBJECT
22325
22583
  };
22584
+ const REMOVE_ATTR_CLASS_APPLYING = new Set(['asap', 'stay', 'complete']);
22326
22585
  /**
22327
22586
  * Scriptlet injection rule converter class
22328
22587
  *
@@ -22358,12 +22617,18 @@ class ScriptletRuleConverter extends RuleConverterBase {
22358
22617
  const scriptletName = QuoteUtils.setStringQuoteType(getScriptletName(scriptletClone), QuoteType.None);
22359
22618
  // Add prefix if it's not already there
22360
22619
  let prefix;
22620
+ // In uBO / ABP syntax, if a parameter contains the separator character, it should be escaped,
22621
+ // but during the conversion, we need to unescape them, because AdGuard syntax uses quotes to
22622
+ // distinguish between parameters.
22623
+ let charToUnescape;
22361
22624
  switch (rule.syntax) {
22362
22625
  case AdblockSyntax.Abp:
22363
22626
  prefix = ABP_SCRIPTLET_PREFIX;
22627
+ charToUnescape = SPACE;
22364
22628
  break;
22365
22629
  case AdblockSyntax.Ubo:
22366
22630
  prefix = UBO_SCRIPTLET_PREFIX;
22631
+ charToUnescape = COMMA_SEPARATOR;
22367
22632
  break;
22368
22633
  default:
22369
22634
  prefix = EMPTY;
@@ -22371,6 +22636,59 @@ class ScriptletRuleConverter extends RuleConverterBase {
22371
22636
  if (!scriptletName.startsWith(prefix)) {
22372
22637
  setScriptletName(scriptletClone, `${prefix}${scriptletName}`);
22373
22638
  }
22639
+ if (!isUndefined(charToUnescape)) {
22640
+ transformAllScriptletArguments(scriptletClone, value => {
22641
+ if (!isNull(value)) {
22642
+ return QuoteUtils.unescapeSingleEscapedOccurrences(value, charToUnescape);
22643
+ }
22644
+ return value;
22645
+ });
22646
+ }
22647
+ if (rule.syntax === AdblockSyntax.Ubo) {
22648
+ const scriptletData = scriptletsCompatibilityTable.getFirst(scriptletName, GenericPlatform.UboAny);
22649
+ // Some scriptlets have special values that need to be converted
22650
+ if (scriptletData && (scriptletData.name === UBO_REMOVE_CLASS_NAME || scriptletData.name === UBO_REMOVE_ATTR_NAME) && scriptletClone.children.length > 2) {
22651
+ const selectors = [];
22652
+ let applying = null;
22653
+ let lastArg = scriptletClone.children.pop();
22654
+ // The very last argument might be the 'applying' parameter
22655
+ if (lastArg) {
22656
+ if (REMOVE_ATTR_CLASS_APPLYING.has(lastArg.value)) {
22657
+ applying = lastArg.value;
22658
+ } else {
22659
+ selectors.push(lastArg.value);
22660
+ }
22661
+ }
22662
+ while (scriptletClone.children.length > 2) {
22663
+ lastArg = scriptletClone.children.pop();
22664
+ if (lastArg) {
22665
+ selectors.push(lastArg.value.trim());
22666
+ }
22667
+ }
22668
+ // Set last arg to be the combined selectors (in reverse order, because we popped them)
22669
+ if (selectors.length > 0) {
22670
+ scriptletClone.children.push({
22671
+ type: 'Value',
22672
+ value: selectors.reverse().join(', ')
22673
+ });
22674
+ }
22675
+ // Push back the 'applying' parameter if it was found previously
22676
+ if (!isNull(applying)) {
22677
+ // If we don't have any selectors,
22678
+ // we need to add an empty parameter before the 'applying' one
22679
+ if (selectors.length === 0) {
22680
+ scriptletClone.children.push({
22681
+ type: 'Value',
22682
+ value: EMPTY
22683
+ });
22684
+ }
22685
+ scriptletClone.children.push({
22686
+ type: 'Value',
22687
+ value: applying
22688
+ });
22689
+ }
22690
+ }
22691
+ }
22374
22692
  // ADG scriptlet parameters should be quoted, and single quoted are preferred
22375
22693
  setScriptletQuoteType(scriptletClone, QuoteType.Single);
22376
22694
  convertedScriptlets.push(scriptletClone);
@@ -22455,13 +22773,28 @@ class ScriptletRuleConverter extends RuleConverterBase {
22455
22773
  // and we need to escape the comma in the second argument to prevent it from being treated
22456
22774
  // as two separate arguments.
22457
22775
  transformAllScriptletArguments(scriptletClone, value => {
22458
- return QuoteUtils.escapeUnescapedOccurrences(value, COMMA_SEPARATOR);
22776
+ if (!isNull(value)) {
22777
+ return QuoteUtils.escapeUnescapedOccurrences(value, COMMA_SEPARATOR);
22778
+ }
22779
+ return value;
22459
22780
  });
22781
+ // Unescape spaces in parameters, because uBlock Origin doesn't treat them as separators.
22782
+ if (rule.syntax === AdblockSyntax.Abp) {
22783
+ transformAllScriptletArguments(scriptletClone, value => {
22784
+ if (!isNull(value)) {
22785
+ return QuoteUtils.unescapeSingleEscapedOccurrences(value, SPACE);
22786
+ }
22787
+ return value;
22788
+ });
22789
+ }
22460
22790
  // Some scriptlets have special values that need to be converted
22461
22791
  switch (scriptletName) {
22462
22792
  case ADG_SET_CONSTANT_NAME:
22463
22793
  transformNthScriptletArgument(scriptletClone, 2, value => {
22464
- return setConstantAdgToUboMap[value] ?? value;
22794
+ if (!isNull(value)) {
22795
+ return setConstantAdgToUboMap[value] ?? value;
22796
+ }
22797
+ return value;
22465
22798
  });
22466
22799
  break;
22467
22800
  case ADG_PREVENT_FETCH_NAME:
@@ -23132,6 +23465,10 @@ const REDIRECT_MODIFIER = 'redirect';
23132
23465
  * @see {@link https://adguard.com/kb/general/ad-filtering/create-own-filters/#redirect-rule-modifier}
23133
23466
  */
23134
23467
  const REDIRECT_RULE_MODIFIER = 'redirect-rule';
23468
+ /**
23469
+ * @see {@link https://github.com/gorhill/uBlock/wiki/Resources-Library#empty-redirect-resources}
23470
+ */
23471
+ const UBO_NOOP_TEXT_RESOURCE = 'noop.txt';
23135
23472
  /**
23136
23473
  * Redirect-related modifiers.
23137
23474
  */
@@ -23281,6 +23618,112 @@ class NetworkRuleModifierListConverter extends ConverterBase {
23281
23618
  }
23282
23619
  return createConversionResult(modifierList, false);
23283
23620
  }
23621
+ /**
23622
+ * Converts a network rule modifier list to uBlock format, if possible.
23623
+ *
23624
+ * @param modifierList Network rule modifier list node to convert
23625
+ * @param isException If `true`, the rule is an exception rule
23626
+ * @returns An object which follows the {@link ConversionResult} interface. Its `result` property contains
23627
+ * the converted node, and its `isConverted` flag indicates whether the original node was converted.
23628
+ * If the node was not converted, the result will contain the original node with the same object reference
23629
+ * @throws If the conversion is not possible
23630
+ */
23631
+ // TODO: Optimize
23632
+ static convertToUbo(modifierList, isException = false) {
23633
+ const conversionMap = new MultiValueMap();
23634
+ const resourceTypeModifiersToAdd = new Set();
23635
+ modifierList.children.forEach((modifierNode, index) => {
23636
+ const originalModifierName = modifierNode.name.value;
23637
+ const modifierData = modifiersCompatibilityTable.getFirst(originalModifierName, GenericPlatform.UboAny);
23638
+ // Handle special case: resource redirection modifiers
23639
+ if (REDIRECT_MODIFIERS.has(originalModifierName)) {
23640
+ // Redirect modifiers cannot be negated
23641
+ if (modifierNode.exception === true) {
23642
+ throw new RuleConversionError(`Modifier '${modifierNode.name.value}' cannot be negated`);
23643
+ }
23644
+ // Convert the redirect resource name to uBO format
23645
+ const redirectResourceName = modifierNode.value?.value;
23646
+ // Special case: for exception rules, $redirect without value is allowed,
23647
+ // and in this case it means an exception for all redirects
23648
+ if (!redirectResourceName && !isException) {
23649
+ throw new RuleConversionError(`No redirect resource specified for '${modifierNode.name.value}' modifier`);
23650
+ }
23651
+ if (!redirectResourceName) {
23652
+ // Jump to the next modifier if the redirect resource is not specified
23653
+ return;
23654
+ }
23655
+ // Leave $redirect and $redirect-rule modifiers as is, but convert $rewrite to $redirect
23656
+ const modifierName = modifierNode.name.value === ABP_REWRITE_MODIFIER ? REDIRECT_MODIFIER : modifierNode.name.value;
23657
+ const convertedRedirectResourceData = redirectsCompatibilityTable.getFirst(redirectResourceName, GenericPlatform.UboAny);
23658
+ const convertedRedirectResourceName = convertedRedirectResourceData?.name ?? redirectResourceName;
23659
+ // uBlock requires the $redirect modifier to have a resource type
23660
+ // https://github.com/AdguardTeam/Scriptlets/issues/101
23661
+ if (convertedRedirectResourceData?.resourceTypes?.length) {
23662
+ // Convert the resource types to uBO modifiers
23663
+ const uboResourceTypeModifiers = redirectsCompatibilityTable.getResourceTypeModifiers(convertedRedirectResourceData, GenericPlatform.UboAny);
23664
+ // Special case: noop text resource
23665
+ // If any of resource type is already present, we don't need to add other resource types,
23666
+ // otherwise, add all resource types
23667
+ // TODO: Optimize this logic
23668
+ // Check if the current resource is the noop text resource
23669
+ const isNoopTextResource = convertedRedirectResourceName === UBO_NOOP_TEXT_RESOURCE;
23670
+ // Determine if there are any valid resource types already present
23671
+ const hasValidResourceType = modifierList.children.some(modifier => {
23672
+ const name = modifier.name.value;
23673
+ if (!isValidResourceType(name)) {
23674
+ return false;
23675
+ }
23676
+ const convertedModifierData = modifiersCompatibilityTable.getFirst(name, GenericPlatform.UboAny);
23677
+ return uboResourceTypeModifiers.has(convertedModifierData?.name ?? name);
23678
+ });
23679
+ // If it's not the noop text resource or if no valid resource types are present
23680
+ if (!isNoopTextResource || !hasValidResourceType) {
23681
+ uboResourceTypeModifiers.forEach(resourceType => {
23682
+ resourceTypeModifiersToAdd.add(resourceType);
23683
+ });
23684
+ }
23685
+ }
23686
+ // Check if the modifier name or the redirect resource name is different from the original modifier.
23687
+ // If so, add the converted modifier to the list
23688
+ if (modifierName !== originalModifierName || !isUndefined(convertedRedirectResourceName) && convertedRedirectResourceName !== redirectResourceName) {
23689
+ conversionMap.add(index, createModifierNode(modifierName,
23690
+ // If the redirect resource name is unknown, fall back to the original one
23691
+ // Later, the validator will throw an error if the resource name is invalid
23692
+ convertedRedirectResourceName || redirectResourceName, modifierNode.exception));
23693
+ }
23694
+ return;
23695
+ }
23696
+ // Generic modifier conversion
23697
+ if (modifierData && modifierData.name !== originalModifierName) {
23698
+ conversionMap.add(index, createModifierNode(modifierData.name, modifierNode.value?.value, modifierNode.exception));
23699
+ }
23700
+ });
23701
+ // Prepare the result if there are any converted modifiers or $csp modifiers
23702
+ if (conversionMap.size || resourceTypeModifiersToAdd.size) {
23703
+ const modifierListClone = cloneModifierListNode(modifierList);
23704
+ // Replace the original modifiers with the converted ones
23705
+ // One modifier may be replaced with multiple modifiers, so we need to flatten the array
23706
+ modifierListClone.children = modifierListClone.children.map((modifierNode, index) => {
23707
+ const conversionRecord = conversionMap.get(index);
23708
+ if (conversionRecord) {
23709
+ return conversionRecord;
23710
+ }
23711
+ return modifierNode;
23712
+ }).flat();
23713
+ // Before returning the result, remove duplicated modifiers
23714
+ modifierListClone.children = modifierListClone.children.filter((modifierNode, index, self) => self.findIndex(m => m.name.value === modifierNode.name.value && m.exception === modifierNode.exception && m.value?.value === modifierNode.value?.value) === index);
23715
+ if (resourceTypeModifiersToAdd.size) {
23716
+ const modifierNameSet = new Set(modifierList.children.map(m => m.name.value));
23717
+ resourceTypeModifiersToAdd.forEach(resourceType => {
23718
+ if (!modifierNameSet.has(resourceType)) {
23719
+ modifierListClone.children.push(createModifierNode(resourceType));
23720
+ }
23721
+ });
23722
+ }
23723
+ return createConversionResult(modifierListClone, true);
23724
+ }
23725
+ return createConversionResult(modifierList, false);
23726
+ }
23284
23727
  }
23285
23728
 
23286
23729
  /**
@@ -23330,6 +23773,44 @@ class NetworkRuleConverter extends RuleConverterBase {
23330
23773
  // If the modifiers were not converted, return the original rule
23331
23774
  return createNodeConversionResult([rule], false);
23332
23775
  }
23776
+ /**
23777
+ * Converts a network rule to uBlock format, if possible.
23778
+ *
23779
+ * @param rule Rule node to convert
23780
+ * @returns An object which follows the {@link NodeConversionResult} interface. Its `result` property contains
23781
+ * the array of converted rule nodes, and its `isConverted` flag indicates whether the original rule was converted.
23782
+ * If the rule was not converted, the result array will contain the original node with the same object reference
23783
+ * @throws If the rule is invalid or cannot be converted
23784
+ */
23785
+ static convertToUbo(rule) {
23786
+ // TODO: add support for host rules
23787
+ if (rule.type !== NetworkRuleType.NetworkRule) {
23788
+ throw new Error(`Invalid rule type: ${rule.type}`);
23789
+ }
23790
+ if (rule.modifiers) {
23791
+ const modifiers = NetworkRuleModifierListConverter.convertToUbo(rule.modifiers, rule.exception);
23792
+ // If the object reference is different, it means that the modifiers were converted
23793
+ // In this case, we should clone the entire rule and replace the modifiers with the converted ones
23794
+ if (modifiers.isConverted) {
23795
+ return {
23796
+ result: [{
23797
+ category: RuleCategory.Network,
23798
+ type: NetworkRuleType.NetworkRule,
23799
+ syntax: rule.syntax,
23800
+ exception: rule.exception,
23801
+ pattern: {
23802
+ type: 'Value',
23803
+ value: rule.pattern.value
23804
+ },
23805
+ modifiers: modifiers.result
23806
+ }],
23807
+ isConverted: true
23808
+ };
23809
+ }
23810
+ }
23811
+ // If the modifiers were not converted, return the original rule
23812
+ return createNodeConversionResult([rule], false);
23813
+ }
23333
23814
  }
23334
23815
 
23335
23816
  /**
@@ -23391,6 +23872,9 @@ class RuleConverter extends RuleConverterBase {
23391
23872
  if (rule.category === RuleCategory.Cosmetic) {
23392
23873
  return CosmeticRuleConverter.convertToUbo(rule);
23393
23874
  }
23875
+ if (rule.category === RuleCategory.Network) {
23876
+ return NetworkRuleConverter.convertToUbo(rule);
23877
+ }
23394
23878
  return createConversionResult([rule], false);
23395
23879
  }
23396
23880
  }
@@ -23669,12 +24153,14 @@ class PositionProvider {
23669
24153
  if (sourceCode[i] === LF || sourceCode[i] === FF || sourceCode[i] === CR) {
23670
24154
  currentLine += 1;
23671
24155
  this.lineStartOffsets[currentLine] = sourceCode[i] === CR && sourceCode[i + 1] === LF ? i + 2 : i + 1;
23672
- if (sourceCode[i] === CR) {
24156
+ if (sourceCode[i] === CR && sourceCode[i + 1] === LF) {
23673
24157
  // Skip the '\n' in a '\r\n' sequence
23674
24158
  i += 1;
23675
24159
  }
23676
24160
  }
23677
24161
  }
24162
+ // Handle the case where the last offset is at the end of the source code
24163
+ this.offsetToLine[sourceCode.length] = currentLine;
23678
24164
  }
23679
24165
  /**
23680
24166
  * Converts a character offset to a line and column position.
@@ -23683,7 +24169,7 @@ class PositionProvider {
23683
24169
  * @returns A Position object containing the 1-based line and column number, or null if the offset is out of range.
23684
24170
  */
23685
24171
  convertOffsetToPosition(offset) {
23686
- if (offset < 0 || offset >= this.offsetToLine.length) {
24172
+ if (offset < 0 || offset > this.offsetToLine.length - 1) {
23687
24173
  return null;
23688
24174
  }
23689
24175
  const line = this.offsetToLine[offset];
@@ -24440,7 +24926,7 @@ class RuleCategorizer {
24440
24926
  }
24441
24927
  }
24442
24928
  }
24443
- const version = "2.0.0";
24929
+ const version = "2.0.2";
24444
24930
 
24445
24931
  /**
24446
24932
  * @file AGTree version
@@ -24450,4 +24936,4 @@ const version = "2.0.0";
24450
24936
  // `tsc` in the root directory, it will generate `dist/types/src/version.d.ts`
24451
24937
  // with wrong relative path to `package.json`. So we need this little "hack"
24452
24938
  const AGTREE_VERSION = version;
24453
- export { ADBLOCK_URL_SEPARATOR, ADBLOCK_URL_SEPARATOR_REGEX, ADBLOCK_URL_START, ADBLOCK_URL_START_REGEX, ADBLOCK_WILDCARD, ADBLOCK_WILDCARD_REGEX, ADG_SCRIPTLET_MASK, AGLINT_COMMAND_PREFIX, AGTREE_VERSION, AdblockSyntax, AdblockSyntaxError, AgentCommentRuleParser, AgentParser, AppListParser, BINARY_SCHEMA_VERSION, BinarySchemaMismatchError, ByteBuffer, COMMA_DOMAIN_LIST_SEPARATOR, CommentMarker, CommentRuleParser, CommentRuleType, ConfigCommentRuleParser, CosmeticRuleParser, CosmeticRuleSeparator, CosmeticRuleSeparatorUtils, CosmeticRuleType, DomainListParser, DomainUtils, EXT_CSS_LEGACY_ATTRIBUTES, EXT_CSS_PSEUDO_CLASSES, FORBIDDEN_CSS_FUNCTIONS, FilterListConverter, FilterListParser, GenericPlatform, HINT_MARKER, HintCommentRuleParser, HintParser, HostRuleParser, IF, INCLUDE, InputByteBuffer, KNOWN_METADATA_HEADERS, LogicalExpressionParser, LogicalExpressionUtils, MODIFIERS_SEPARATOR, MODIFIER_ASSIGN_OPERATOR, MetadataCommentRuleParser, MethodListParser, ModifierListParser, ModifierParser, NEGATION_MARKER, NETWORK_RULE_EXCEPTION_MARKER, NETWORK_RULE_SEPARATOR, NetworkRuleParser, NetworkRuleType, NotImplementedError, OutputByteBuffer, PIPE_MODIFIER_SEPARATOR, PREPROCESSOR_MARKER, ParameterListParser, PositionProvider, PreProcessorCommentRuleParser, QuoteType, QuoteUtils, RawFilterListConverter, RawRuleConverter, RegExpUtils, RuleCategorizer, RuleCategory, RuleConversionError, RuleConverter, RuleParser, SAFARI_CB_AFFINITY, SPECIAL_REGEX_SYMBOLS, SpecificPlatform, StealthOptionListParser, UBO_SCRIPTLET_MASK, decodeTextPolyfill, defaultParserOptions, encodeIntoPolyfill, getPlatformId, getSpecificPlatformName, isGenericPlatform, modifierValidator, modifiersCompatibilityTable, parseRawPlatforms, redirectsCompatibilityTable, scriptletsCompatibilityTable };
24939
+ export { ADBLOCK_URL_SEPARATOR, ADBLOCK_URL_SEPARATOR_REGEX, ADBLOCK_URL_START, ADBLOCK_URL_START_REGEX, ADBLOCK_WILDCARD, ADBLOCK_WILDCARD_REGEX, ADG_SCRIPTLET_MASK, AGLINT_COMMAND_PREFIX, AGTREE_VERSION, AdblockSyntax, AdblockSyntaxError, AgentCommentRuleParser, AgentParser, AppListParser, BINARY_SCHEMA_VERSION, BinarySchemaMismatchError, ByteBuffer, COMMA_DOMAIN_LIST_SEPARATOR, CommentMarker, CommentRuleParser, CommentRuleType, ConfigCommentRuleParser, CosmeticRuleParser, CosmeticRuleSeparator, CosmeticRuleSeparatorUtils, CosmeticRuleType, DomainListParser, DomainUtils, EXT_CSS_LEGACY_ATTRIBUTES, EXT_CSS_PSEUDO_CLASSES, FORBIDDEN_CSS_FUNCTIONS, FilterListConverter, FilterListParser, GenericPlatform, HINT_MARKER, HintCommentRuleParser, HintParser, HostRuleParser, IF, INCLUDE, InputByteBuffer, KNOWN_METADATA_HEADERS, LogicalExpressionParser, LogicalExpressionUtils, MODIFIERS_SEPARATOR, MODIFIER_ASSIGN_OPERATOR, MetadataCommentRuleParser, MethodListParser, ModifierListParser, ModifierParser, NEGATION_MARKER, NETWORK_RULE_EXCEPTION_MARKER, NETWORK_RULE_SEPARATOR, NetworkRuleParser, NetworkRuleType, NotImplementedError, OutputByteBuffer, PIPE_MODIFIER_SEPARATOR, PREPROCESSOR_MARKER, ParameterListParser, PositionProvider, PreProcessorCommentRuleParser, QuoteType, QuoteUtils, RawFilterListConverter, RawRuleConverter, RegExpUtils, ResourceType, RuleCategorizer, RuleCategory, RuleConversionError, RuleConverter, RuleParser, SAFARI_CB_AFFINITY, SPECIAL_REGEX_SYMBOLS, SpecificPlatform, StealthOptionListParser, UBO_SCRIPTLET_MASK, decodeTextPolyfill, defaultParserOptions, encodeIntoPolyfill, getPlatformId, getResourceTypeModifier, getSpecificPlatformName, isGenericPlatform, isValidResourceType, modifierValidator, modifiersCompatibilityTable, parseRawPlatforms, redirectsCompatibilityTable, scriptletsCompatibilityTable };