@adguard/agtree 3.4.3 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ast-utils/clone.js +2 -2
- package/dist/ast-utils/modifiers.js +2 -2
- package/dist/ast-utils/network-rules.js +2 -2
- package/dist/ast-utils/scriptlets.js +2 -2
- package/dist/common/abp-snippet-injection-body-common.js +2 -2
- package/dist/common/agent-common.js +2 -2
- package/dist/common/ubo-html-filtering-body-common.js +40 -0
- package/dist/common/ubo-selector-common.js +2 -2
- package/dist/compatibility-tables/base.js +2 -2
- package/dist/compatibility-tables/compatibility-table-data.js +2 -2
- package/dist/compatibility-tables/modifiers.js +2 -2
- package/dist/compatibility-tables/platforms.js +2 -2
- package/dist/compatibility-tables/redirects.js +2 -2
- package/dist/compatibility-tables/schemas/base.js +2 -2
- package/dist/compatibility-tables/schemas/modifier.js +2 -2
- package/dist/compatibility-tables/schemas/platform.js +2 -2
- package/dist/compatibility-tables/schemas/redirect.js +2 -2
- package/dist/compatibility-tables/schemas/resource-type.js +2 -2
- package/dist/compatibility-tables/schemas/scriptlet.js +2 -2
- package/dist/compatibility-tables/scriptlets.js +2 -2
- package/dist/compatibility-tables/utils/platform-helpers.js +2 -2
- package/dist/compatibility-tables/utils/resource-type-helpers.js +2 -2
- package/dist/compatibility-tables/utils/zod-camelcase.js +2 -2
- package/dist/converter/base-interfaces/base-converter.js +2 -2
- package/dist/converter/base-interfaces/conversion-result.js +2 -2
- package/dist/converter/base-interfaces/rule-converter-base.js +2 -2
- package/dist/converter/comment/index.js +2 -2
- package/dist/converter/cosmetic/css.js +2 -2
- package/dist/converter/cosmetic/element-hiding.js +2 -2
- package/dist/converter/cosmetic/header-removal.js +24 -42
- package/dist/converter/cosmetic/html.js +580 -438
- package/dist/converter/cosmetic/index.js +3 -2
- package/dist/converter/cosmetic/rule-modifiers/adg.js +2 -2
- package/dist/converter/cosmetic/rule-modifiers/ubo.js +2 -2
- package/dist/converter/cosmetic/scriptlet.js +2 -2
- package/dist/converter/css/index.js +3 -2
- package/dist/converter/data/css.js +32 -54
- package/dist/converter/filter-list.js +2 -2
- package/dist/converter/index.js +2 -2
- package/dist/converter/misc/network-rule-modifier.js +2 -2
- package/dist/converter/network/index.js +2 -2
- package/dist/converter/raw-filter-list.js +2 -2
- package/dist/converter/raw-rule.js +6 -3
- package/dist/converter/rule.js +2 -2
- package/dist/errors/adblock-syntax-error.js +2 -2
- package/dist/errors/binary-schema-mismatch-error.js +2 -2
- package/dist/errors/not-implemented-error.js +2 -2
- package/dist/errors/rule-conversion-error.js +2 -2
- package/dist/generator/base-generator.js +2 -2
- package/dist/generator/comment/agent-comment-generator.js +2 -2
- package/dist/generator/comment/agent-generator.js +2 -2
- package/dist/generator/comment/comment-rule-generator.js +2 -2
- package/dist/generator/comment/config-comment-generator.js +2 -2
- package/dist/generator/comment/hint-comment-generator.js +2 -2
- package/dist/generator/comment/hint-generator.js +2 -2
- package/dist/generator/comment/metadata-comment-generator.js +2 -2
- package/dist/generator/comment/pre-processor-comment-generator.js +2 -2
- package/dist/generator/comment/simple-comment-generator.js +2 -2
- package/dist/generator/cosmetic/cosmetic-rule-body-generator.js +21 -6
- package/dist/generator/cosmetic/cosmetic-rule-generator.js +2 -2
- package/dist/generator/cosmetic/cosmetic-rule-pattern-generator.js +2 -2
- package/dist/generator/cosmetic/html-filtering-body/adg-html-filtering-body-generator.js +38 -0
- package/dist/generator/cosmetic/html-filtering-body/html-filtering-body-generator.js +32 -0
- package/dist/generator/cosmetic/html-filtering-body/ubo-html-filtering-body-generator.js +65 -0
- package/dist/generator/cosmetic/{body → scriptlet-body}/abp-snippet-injection-body-generator.js +2 -2
- package/dist/generator/cosmetic/{body → scriptlet-body}/adg-scriptlet-injection-body-generator.js +2 -2
- package/dist/generator/cosmetic/{body → scriptlet-body}/ubo-scriptlet-injection-body-generator.js +2 -2
- package/dist/generator/cosmetic/selector/attribute-selector-generator.js +42 -0
- package/dist/generator/cosmetic/selector/class-selector-generator.js +26 -0
- package/dist/generator/cosmetic/selector/complex-selector-generator.js +71 -0
- package/dist/generator/cosmetic/selector/id-selector-generator.js +26 -0
- package/dist/generator/cosmetic/selector/pseudo-class-selector-generator.js +35 -0
- package/dist/generator/cosmetic/selector/selector-combinator-generator.js +30 -0
- package/dist/generator/cosmetic/selector/selector-list-generator.js +41 -0
- package/dist/generator/cosmetic/selector/type-selector-generator.js +25 -0
- package/dist/generator/css/adg-css-injection-generator.js +5 -6
- package/dist/generator/filterlist-generator.js +2 -2
- package/dist/generator/index.js +2 -2
- package/dist/generator/misc/domain-list-generator.js +2 -2
- package/dist/generator/misc/list-items-generator.js +2 -2
- package/dist/generator/misc/logical-expression-generator.js +2 -2
- package/dist/generator/misc/modifier-generator.js +2 -2
- package/dist/generator/misc/modifier-list-generator.js +2 -2
- package/dist/generator/misc/parameter-list-generator.js +2 -2
- package/dist/generator/misc/value-generator.js +2 -2
- package/dist/generator/network/host-rule-generator.js +2 -2
- package/dist/generator/network/network-rule-generator.js +2 -2
- package/dist/generator/rule-generator.js +2 -2
- package/dist/index.js +4 -14
- package/dist/nodes/index.js +2 -2
- package/dist/package.json.js +3 -3
- package/dist/parser/base-parser.js +2 -2
- package/dist/parser/comment/agent-comment-parser.js +2 -2
- package/dist/parser/comment/agent-parser.js +2 -2
- package/dist/parser/comment/comment-parser.js +2 -2
- package/dist/parser/comment/config-comment-parser.js +2 -2
- package/dist/parser/comment/hint-comment-parser.js +2 -2
- package/dist/parser/comment/hint-parser.js +2 -2
- package/dist/parser/comment/metadata-comment-parser.js +2 -2
- package/dist/parser/comment/preprocessor-parser.js +2 -2
- package/dist/parser/comment/simple-comment-parser.js +2 -2
- package/dist/parser/cosmetic/cosmetic-rule-parser.js +10 -21
- package/dist/parser/cosmetic/html-filtering-body/adg-html-filtering-body-parser.js +49 -0
- package/dist/parser/cosmetic/html-filtering-body/html-filtering-body-parser.js +70 -0
- package/dist/parser/cosmetic/html-filtering-body/ubo-html-filtering-body-parser.js +180 -0
- package/dist/parser/cosmetic/{body → scriptlet-body}/abp-snippet-injection-body-parser.js +2 -2
- package/dist/parser/cosmetic/{body → scriptlet-body}/adg-scriptlet-injection-body-parser.js +2 -2
- package/dist/parser/cosmetic/{body → scriptlet-body}/ubo-scriptlet-injection-body-parser.js +2 -2
- package/dist/parser/cosmetic/selector/handlers/attribute-selector-handler.js +206 -0
- package/dist/parser/cosmetic/selector/handlers/class-selector-handler.js +48 -0
- package/dist/parser/cosmetic/selector/handlers/complex-selector-handler.js +67 -0
- package/dist/parser/cosmetic/selector/handlers/compound-selector-handler.js +97 -0
- package/dist/parser/cosmetic/selector/handlers/id-selector-handler.js +42 -0
- package/dist/parser/cosmetic/selector/handlers/pseudo-class-selector-handler.js +128 -0
- package/dist/parser/cosmetic/selector/handlers/type-selector-handler.js +58 -0
- package/dist/parser/cosmetic/selector/selector-list-parser.js +164 -0
- package/dist/parser/css/adg-css-injection-parser.js +4 -5
- package/dist/parser/css/balancing.js +2 -2
- package/dist/parser/css/constants.js +2 -2
- package/dist/parser/css/css-token-stream.js +41 -4
- package/dist/parser/css/ubo-selector-parser.js +2 -2
- package/dist/parser/filterlist-parser.js +2 -2
- package/dist/parser/index.js +2 -2
- package/dist/parser/misc/app-list-parser.js +2 -2
- package/dist/parser/misc/domain-list-parser.js +2 -2
- package/dist/parser/misc/list-items-parser.js +2 -2
- package/dist/parser/misc/logical-expression-parser.js +2 -2
- package/dist/parser/misc/method-list-parser.js +2 -2
- package/dist/parser/misc/modifier-list.js +2 -2
- package/dist/parser/misc/modifier-parser.js +2 -2
- package/dist/parser/misc/parameter-list-parser.js +2 -2
- package/dist/parser/misc/stealth-option-list-parser.js +2 -2
- package/dist/parser/misc/ubo-parameter-list-parser.js +2 -2
- package/dist/parser/misc/value-parser.js +2 -2
- package/dist/parser/network/host-rule-parser.js +2 -2
- package/dist/parser/network/network-rule-parser.js +2 -2
- package/dist/parser/options.js +3 -2
- package/dist/parser/rule-parser.js +2 -2
- package/dist/types/common/ubo-html-filtering-body-common.d.ts +12 -0
- package/dist/types/compatibility-tables/compatibility-table-data.d.ts +3 -3
- package/dist/types/compatibility-tables/schemas/redirect.d.ts +1 -1
- package/dist/types/compatibility-tables/schemas/scriptlet.d.ts +2 -2
- package/dist/types/converter/cosmetic/html.d.ts +167 -42
- package/dist/types/converter/data/css.d.ts +18 -6
- package/dist/types/generator/cosmetic/html-filtering-body/adg-html-filtering-body-generator.d.ts +17 -0
- package/dist/types/generator/cosmetic/html-filtering-body/html-filtering-body-generator.d.ts +17 -0
- package/dist/types/generator/cosmetic/html-filtering-body/ubo-html-filtering-body-generator.d.ts +30 -0
- package/dist/types/generator/cosmetic/selector/attribute-selector-generator.d.ts +15 -0
- package/dist/types/generator/cosmetic/selector/class-selector-generator.d.ts +15 -0
- package/dist/types/generator/cosmetic/selector/complex-selector-generator.d.ts +17 -0
- package/dist/types/generator/cosmetic/selector/id-selector-generator.d.ts +15 -0
- package/dist/types/generator/cosmetic/selector/pseudo-class-selector-generator.d.ts +15 -0
- package/dist/types/generator/cosmetic/selector/selector-combinator-generator.d.ts +15 -0
- package/dist/types/generator/cosmetic/selector/selector-list-generator.d.ts +17 -0
- package/dist/types/generator/cosmetic/selector/type-selector-generator.d.ts +15 -0
- package/dist/types/generator/css/adg-css-injection-generator.d.ts +1 -1
- package/dist/types/index.d.ts +3 -13
- package/dist/types/nodes/index.d.ts +159 -3
- package/dist/types/parser/cosmetic/html-filtering-body/adg-html-filtering-body-parser.d.ts +35 -0
- package/dist/types/parser/cosmetic/html-filtering-body/html-filtering-body-parser.d.ts +39 -0
- package/dist/types/parser/cosmetic/html-filtering-body/ubo-html-filtering-body-parser.d.ts +63 -0
- package/dist/types/parser/cosmetic/selector/context.d.ts +42 -0
- package/dist/types/parser/cosmetic/selector/handlers/attribute-selector-handler.d.ts +35 -0
- package/dist/types/parser/cosmetic/selector/handlers/class-selector-handler.d.ts +15 -0
- package/dist/types/parser/cosmetic/selector/handlers/complex-selector-handler.d.ts +20 -0
- package/dist/types/parser/cosmetic/selector/handlers/compound-selector-handler.d.ts +25 -0
- package/dist/types/parser/cosmetic/selector/handlers/id-selector-handler.d.ts +15 -0
- package/dist/types/parser/cosmetic/selector/handlers/pseudo-class-selector-handler.d.ts +15 -0
- package/dist/types/parser/cosmetic/selector/handlers/type-selector-handler.d.ts +15 -0
- package/dist/types/parser/cosmetic/selector/selector-list-parser.d.ts +38 -0
- package/dist/types/parser/css/adg-css-injection-parser.d.ts +0 -2
- package/dist/types/parser/css/css-token-stream.d.ts +18 -0
- package/dist/types/parser/network/network-rule-parser.d.ts +1 -1
- package/dist/types/parser/options.d.ts +5 -0
- package/dist/types/utils/constants.d.ts +1 -0
- package/dist/types/utils/index.d.ts +0 -6
- package/dist/types/utils/quotes.d.ts +44 -0
- package/dist/types/utils/regexp.d.ts +24 -0
- package/dist/utils/adblockers.js +2 -2
- package/dist/utils/bit-count.js +2 -2
- package/dist/utils/categorizer.js +2 -2
- package/dist/utils/clone.js +2 -2
- package/dist/utils/constants.js +6 -9
- package/dist/utils/cosmetic-rule-separator.js +2 -2
- package/dist/utils/deep-freeze.js +2 -2
- package/dist/utils/domain.js +2 -2
- package/dist/utils/error.js +2 -2
- package/dist/utils/index.js +2 -8
- package/dist/utils/logical-expression.js +2 -2
- package/dist/utils/multi-value-map.js +2 -2
- package/dist/utils/noop-modifier.js +2 -2
- package/dist/utils/position-provider.js +2 -2
- package/dist/utils/quotes.js +163 -10
- package/dist/utils/regexp.js +31 -2
- package/dist/utils/string.js +2 -2
- package/dist/utils/type-guards.js +3 -13
- package/dist/validator/constants.js +2 -2
- package/dist/validator/helpers.js +2 -2
- package/dist/validator/index.js +2 -2
- package/dist/validator/value.js +2 -2
- package/dist/version.js +2 -2
- package/package.json +6 -14
- package/dist/deserializer/base-deserializer.js +0 -29
- package/dist/deserializer/comment/agent-comment-deserializer.js +0 -79
- package/dist/deserializer/comment/agent-deserializer.js +0 -65
- package/dist/deserializer/comment/comment-rule-deserializer.js +0 -54
- package/dist/deserializer/comment/config-comment-deserializer.js +0 -111
- package/dist/deserializer/comment/hint-comment-deserializer.js +0 -72
- package/dist/deserializer/comment/hint-deserializer.js +0 -85
- package/dist/deserializer/comment/metadata-comment-deserializer.js +0 -69
- package/dist/deserializer/comment/pre-processor-comment-deserializer.js +0 -112
- package/dist/deserializer/comment/simple-comment-deserializer.js +0 -65
- package/dist/deserializer/cosmetic/cosmetic-rule-deserializer.js +0 -131
- package/dist/deserializer/cosmetic/css-injection-body-deserializer.js +0 -56
- package/dist/deserializer/cosmetic/element-hiding-body-deserializer.js +0 -48
- package/dist/deserializer/cosmetic/scriptlet-body/abp-snippet-injection-body-deserializer.js +0 -39
- package/dist/deserializer/cosmetic/scriptlet-body/adg-scriptlet-injection-body-deserializer.js +0 -40
- package/dist/deserializer/cosmetic/scriptlet-body/scriptlet-body-deserializer.js +0 -54
- package/dist/deserializer/cosmetic/scriptlet-body/ubo-scriptlet-injection-body-deserializer.js +0 -38
- package/dist/deserializer/empty-rule-deserializer.js +0 -48
- package/dist/deserializer/filterlist-deserializer.js +0 -85
- package/dist/deserializer/index.js +0 -8
- package/dist/deserializer/invalid-rule-deserializer.js +0 -50
- package/dist/deserializer/invalid-rule-error-node-deserializer.js +0 -50
- package/dist/deserializer/misc/domain-list-deserializer.js +0 -64
- package/dist/deserializer/misc/list-item-deserializer.js +0 -69
- package/dist/deserializer/misc/list-items-deserializer.js +0 -30
- package/dist/deserializer/misc/logical-expression-deserializer.js +0 -196
- package/dist/deserializer/misc/modifier-deserializer.js +0 -87
- package/dist/deserializer/misc/modifier-list-deserializer.js +0 -61
- package/dist/deserializer/misc/parameter-list-deserializer.js +0 -64
- package/dist/deserializer/misc/value-deserializer.js +0 -50
- package/dist/deserializer/network/host-rule-deserializer.js +0 -67
- package/dist/deserializer/network/hostname-list-deserializer.js +0 -56
- package/dist/deserializer/network/network-rule-deserializer.js +0 -65
- package/dist/deserializer/rule-deserializer.js +0 -65
- package/dist/deserializer/syntax-deserialization-map.js +0 -21
- package/dist/marshalling-utils/comment/agent-comment-common.js +0 -21
- package/dist/marshalling-utils/comment/agent-common.js +0 -40
- package/dist/marshalling-utils/comment/config-comment-common.js +0 -54
- package/dist/marshalling-utils/comment/hint-comment-common.js +0 -22
- package/dist/marshalling-utils/comment/hint-common.js +0 -56
- package/dist/marshalling-utils/comment/metadata-comment-common.js +0 -41
- package/dist/marshalling-utils/comment/pre-processor-comment-common.js +0 -59
- package/dist/marshalling-utils/comment/simple-comment-common.js +0 -22
- package/dist/marshalling-utils/cosmetic/body/abp-snippet-injection-body-common.js +0 -61
- package/dist/marshalling-utils/cosmetic/body/adg-scriptlet-injection-body-common.js +0 -66
- package/dist/marshalling-utils/cosmetic/body/css-injection-body-common.js +0 -24
- package/dist/marshalling-utils/cosmetic/body/element-hiding-body-common.js +0 -21
- package/dist/marshalling-utils/cosmetic/body/ubo-scriptlet-injection-body-common.js +0 -114
- package/dist/marshalling-utils/cosmetic/cosmetic-rule-common.js +0 -46
- package/dist/marshalling-utils/empty-rule-common.js +0 -20
- package/dist/marshalling-utils/filter-list-common.js +0 -21
- package/dist/marshalling-utils/invalid-rule-common.js +0 -21
- package/dist/marshalling-utils/invalid-rule-error-node-common.js +0 -22
- package/dist/marshalling-utils/misc/binary-type-common.js +0 -54
- package/dist/marshalling-utils/misc/domain-list-common.js +0 -36
- package/dist/marshalling-utils/misc/host-rule-common.js +0 -24
- package/dist/marshalling-utils/misc/hostname-list-common.js +0 -21
- package/dist/marshalling-utils/misc/list-item-common.js +0 -22
- package/dist/marshalling-utils/misc/logical-expression-common.js +0 -83
- package/dist/marshalling-utils/misc/modifier-common.js +0 -231
- package/dist/marshalling-utils/misc/modifier-list-common.js +0 -21
- package/dist/marshalling-utils/misc/parameter-list-common.js +0 -21
- package/dist/marshalling-utils/misc/value-common.js +0 -22
- package/dist/marshalling-utils/network/network-rule-common.js +0 -24
- package/dist/marshalling-utils/syntax-serialization-map.js +0 -30
- package/dist/serializer/base-serializer.js +0 -29
- package/dist/serializer/comment/agent-comment-serializer.js +0 -74
- package/dist/serializer/comment/agent-serializer.js +0 -59
- package/dist/serializer/comment/comment-rule-serializer.js +0 -105
- package/dist/serializer/comment/config-comment-serializer.js +0 -82
- package/dist/serializer/comment/hint-comment-serializer.js +0 -65
- package/dist/serializer/comment/hint-serializer.js +0 -54
- package/dist/serializer/comment/metadata-comment-serializer.js +0 -73
- package/dist/serializer/comment/pre-processor-comment-serializer.js +0 -71
- package/dist/serializer/comment/simple-comment-serializer.js +0 -52
- package/dist/serializer/cosmetic/body/abp-snippet-injection-body-serializer.js +0 -36
- package/dist/serializer/cosmetic/body/adg-scriptlet-injection-body-serializer.js +0 -36
- package/dist/serializer/cosmetic/body/scriptlet-body-serializer.js +0 -50
- package/dist/serializer/cosmetic/body/ubo-scriptlet-injection-body-serializer.js +0 -36
- package/dist/serializer/cosmetic/cosmetic-rule-serializer.js +0 -120
- package/dist/serializer/cosmetic/css-injection-body-serializer.js +0 -51
- package/dist/serializer/cosmetic/element-hiding-body-serializer.js +0 -40
- package/dist/serializer/empty-rule-serializer.js +0 -37
- package/dist/serializer/filterlist-serializer.js +0 -45
- package/dist/serializer/index.js +0 -7
- package/dist/serializer/invalid-rule-error-node-serializer.js +0 -41
- package/dist/serializer/invalid-rule-serializer.js +0 -40
- package/dist/serializer/misc/domain-list-serializer.js +0 -64
- package/dist/serializer/misc/list-item-serializer.js +0 -58
- package/dist/serializer/misc/list-items-serializer.js +0 -29
- package/dist/serializer/misc/logical-expression-serializer.js +0 -136
- package/dist/serializer/misc/modifier-list-serializer.js +0 -58
- package/dist/serializer/misc/modifier-serializer.js +0 -49
- package/dist/serializer/misc/parameter-list-serializer.js +0 -52
- package/dist/serializer/misc/value-serializer.js +0 -50
- package/dist/serializer/network/host-rule-serializer.js +0 -70
- package/dist/serializer/network/hostname-list-serializer.js +0 -53
- package/dist/serializer/network/network-rule-serializer.js +0 -54
- package/dist/serializer/rule-serializer.js +0 -61
- package/dist/types/deserializer/base-deserializer.d.ts +0 -15
- package/dist/types/deserializer/comment/agent-comment-deserializer.d.ts +0 -34
- package/dist/types/deserializer/comment/agent-deserializer.d.ts +0 -25
- package/dist/types/deserializer/comment/comment-rule-deserializer.d.ts +0 -16
- package/dist/types/deserializer/comment/config-comment-deserializer.d.ts +0 -27
- package/dist/types/deserializer/comment/hint-comment-deserializer.d.ts +0 -24
- package/dist/types/deserializer/comment/hint-deserializer.d.ts +0 -26
- package/dist/types/deserializer/comment/metadata-comment-deserializer.d.ts +0 -26
- package/dist/types/deserializer/comment/pre-processor-comment-deserializer.d.ts +0 -29
- package/dist/types/deserializer/comment/simple-comment-deserializer.d.ts +0 -26
- package/dist/types/deserializer/cosmetic/cosmetic-rule-deserializer.d.ts +0 -18
- package/dist/types/deserializer/cosmetic/css-injection-body-deserializer.d.ts +0 -15
- package/dist/types/deserializer/cosmetic/element-hiding-body-deserializer.d.ts +0 -16
- package/dist/types/deserializer/cosmetic/scriptlet-body/abp-snippet-injection-body-deserializer.d.ts +0 -17
- package/dist/types/deserializer/cosmetic/scriptlet-body/adg-scriptlet-injection-body-deserializer.d.ts +0 -18
- package/dist/types/deserializer/cosmetic/scriptlet-body/scriptlet-body-deserializer.d.ts +0 -19
- package/dist/types/deserializer/cosmetic/scriptlet-body/ubo-scriptlet-injection-body-deserializer.d.ts +0 -17
- package/dist/types/deserializer/empty-rule-deserializer.d.ts +0 -16
- package/dist/types/deserializer/filterlist-deserializer.d.ts +0 -34
- package/dist/types/deserializer/index.d.ts +0 -2
- package/dist/types/deserializer/invalid-rule-deserializer.d.ts +0 -16
- package/dist/types/deserializer/invalid-rule-error-node-deserializer.d.ts +0 -16
- package/dist/types/deserializer/misc/domain-list-deserializer.d.ts +0 -15
- package/dist/types/deserializer/misc/list-item-deserializer.d.ts +0 -19
- package/dist/types/deserializer/misc/list-items-deserializer.d.ts +0 -16
- package/dist/types/deserializer/misc/logical-expression-deserializer.d.ts +0 -55
- package/dist/types/deserializer/misc/modifier-deserializer.d.ts +0 -18
- package/dist/types/deserializer/misc/modifier-list-deserializer.d.ts +0 -20
- package/dist/types/deserializer/misc/parameter-list-deserializer.d.ts +0 -18
- package/dist/types/deserializer/misc/value-deserializer.d.ts +0 -17
- package/dist/types/deserializer/network/host-rule-deserializer.d.ts +0 -18
- package/dist/types/deserializer/network/hostname-list-deserializer.d.ts +0 -15
- package/dist/types/deserializer/network/network-rule-deserializer.d.ts +0 -18
- package/dist/types/deserializer/rule-deserializer.d.ts +0 -17
- package/dist/types/deserializer/syntax-deserialization-map.d.ts +0 -2
- package/dist/types/marshalling-utils/comment/agent-comment-common.d.ts +0 -14
- package/dist/types/marshalling-utils/comment/agent-common.d.ts +0 -20
- package/dist/types/marshalling-utils/comment/config-comment-common.d.ts +0 -42
- package/dist/types/marshalling-utils/comment/hint-comment-common.d.ts +0 -15
- package/dist/types/marshalling-utils/comment/hint-common.d.ts +0 -33
- package/dist/types/marshalling-utils/comment/metadata-comment-common.d.ts +0 -21
- package/dist/types/marshalling-utils/comment/pre-processor-comment-common.d.ts +0 -37
- package/dist/types/marshalling-utils/comment/simple-comment-common.d.ts +0 -15
- package/dist/types/marshalling-utils/cosmetic/body/abp-snippet-injection-body-common.d.ts +0 -23
- package/dist/types/marshalling-utils/cosmetic/body/adg-scriptlet-injection-body-common.d.ts +0 -9
- package/dist/types/marshalling-utils/cosmetic/body/css-injection-body-common.d.ts +0 -17
- package/dist/types/marshalling-utils/cosmetic/body/element-hiding-body-common.d.ts +0 -14
- package/dist/types/marshalling-utils/cosmetic/body/ubo-scriptlet-injection-body-common.d.ts +0 -9
- package/dist/types/marshalling-utils/cosmetic/cosmetic-rule-common.d.ts +0 -28
- package/dist/types/marshalling-utils/empty-rule-common.d.ts +0 -13
- package/dist/types/marshalling-utils/filter-list-common.d.ts +0 -14
- package/dist/types/marshalling-utils/invalid-rule-common.d.ts +0 -14
- package/dist/types/marshalling-utils/invalid-rule-error-node-common.d.ts +0 -15
- package/dist/types/marshalling-utils/misc/binary-type-common.d.ts +0 -57
- package/dist/types/marshalling-utils/misc/domain-list-common.d.ts +0 -24
- package/dist/types/marshalling-utils/misc/host-rule-common.d.ts +0 -18
- package/dist/types/marshalling-utils/misc/hostname-list-common.d.ts +0 -14
- package/dist/types/marshalling-utils/misc/list-item-common.d.ts +0 -15
- package/dist/types/marshalling-utils/misc/logical-expression-common.d.ts +0 -47
- package/dist/types/marshalling-utils/misc/modifier-common.d.ts +0 -41
- package/dist/types/marshalling-utils/misc/modifier-list-common.d.ts +0 -14
- package/dist/types/marshalling-utils/misc/parameter-list-common.d.ts +0 -14
- package/dist/types/marshalling-utils/misc/value-common.d.ts +0 -15
- package/dist/types/marshalling-utils/network/network-rule-common.d.ts +0 -18
- package/dist/types/marshalling-utils/syntax-serialization-map.d.ts +0 -2
- package/dist/types/serializer/base-serializer.d.ts +0 -15
- package/dist/types/serializer/comment/agent-comment-serializer.d.ts +0 -34
- package/dist/types/serializer/comment/agent-serializer.d.ts +0 -15
- package/dist/types/serializer/comment/comment-rule-serializer.d.ts +0 -68
- package/dist/types/serializer/comment/config-comment-serializer.d.ts +0 -25
- package/dist/types/serializer/comment/hint-comment-serializer.d.ts +0 -23
- package/dist/types/serializer/comment/hint-serializer.d.ts +0 -24
- package/dist/types/serializer/comment/metadata-comment-serializer.d.ts +0 -25
- package/dist/types/serializer/comment/pre-processor-comment-serializer.d.ts +0 -28
- package/dist/types/serializer/comment/simple-comment-serializer.d.ts +0 -24
- package/dist/types/serializer/cosmetic/body/abp-snippet-injection-body-serializer.d.ts +0 -25
- package/dist/types/serializer/cosmetic/body/adg-scriptlet-injection-body-serializer.d.ts +0 -25
- package/dist/types/serializer/cosmetic/body/scriptlet-body-serializer.d.ts +0 -17
- package/dist/types/serializer/cosmetic/body/ubo-scriptlet-injection-body-serializer.d.ts +0 -25
- package/dist/types/serializer/cosmetic/cosmetic-rule-serializer.d.ts +0 -19
- package/dist/types/serializer/cosmetic/css-injection-body-serializer.d.ts +0 -15
- package/dist/types/serializer/cosmetic/element-hiding-body-serializer.d.ts +0 -15
- package/dist/types/serializer/empty-rule-serializer.d.ts +0 -15
- package/dist/types/serializer/filterlist-serializer.d.ts +0 -15
- package/dist/types/serializer/index.d.ts +0 -1
- package/dist/types/serializer/invalid-rule-error-node-serializer.d.ts +0 -15
- package/dist/types/serializer/invalid-rule-serializer.d.ts +0 -15
- package/dist/types/serializer/misc/domain-list-serializer.d.ts +0 -21
- package/dist/types/serializer/misc/list-item-serializer.d.ts +0 -16
- package/dist/types/serializer/misc/list-items-serializer.d.ts +0 -15
- package/dist/types/serializer/misc/logical-expression-serializer.d.ts +0 -52
- package/dist/types/serializer/misc/modifier-list-serializer.d.ts +0 -20
- package/dist/types/serializer/misc/modifier-serializer.d.ts +0 -18
- package/dist/types/serializer/misc/parameter-list-serializer.d.ts +0 -17
- package/dist/types/serializer/misc/value-serializer.d.ts +0 -17
- package/dist/types/serializer/network/host-rule-serializer.d.ts +0 -30
- package/dist/types/serializer/network/hostname-list-serializer.d.ts +0 -15
- package/dist/types/serializer/network/network-rule-serializer.d.ts +0 -18
- package/dist/types/serializer/rule-serializer.d.ts +0 -17
- package/dist/types/utils/binary-schema-version.d.ts +0 -9
- package/dist/types/utils/byte-buffer.d.ts +0 -54
- package/dist/types/utils/input-byte-buffer.d.ts +0 -146
- package/dist/types/utils/is-chromium.d.ts +0 -7
- package/dist/types/utils/output-byte-buffer.d.ts +0 -132
- package/dist/types/utils/storage-interface.d.ts +0 -23
- package/dist/types/utils/text-decoder-polyfill.d.ts +0 -14
- package/dist/types/utils/text-encoder-polyfill.d.ts +0 -18
- package/dist/utils/binary-schema-version.js +0 -17
- package/dist/utils/byte-buffer.js +0 -91
- package/dist/utils/input-byte-buffer.js +0 -266
- package/dist/utils/is-chromium.js +0 -20
- package/dist/utils/output-byte-buffer.js +0 -231
- package/dist/utils/text-decoder-polyfill.js +0 -107
- package/dist/utils/text-encoder-polyfill.js +0 -78
- /package/dist/types/generator/cosmetic/{body → scriptlet-body}/abp-snippet-injection-body-generator.d.ts +0 -0
- /package/dist/types/generator/cosmetic/{body → scriptlet-body}/adg-scriptlet-injection-body-generator.d.ts +0 -0
- /package/dist/types/generator/cosmetic/{body → scriptlet-body}/ubo-scriptlet-injection-body-generator.d.ts +0 -0
- /package/dist/types/parser/cosmetic/{body → scriptlet-body}/abp-snippet-injection-body-parser.d.ts +0 -0
- /package/dist/types/parser/cosmetic/{body → scriptlet-body}/adg-scriptlet-injection-body-parser.d.ts +0 -0
- /package/dist/types/parser/cosmetic/{body → scriptlet-body}/ubo-scriptlet-injection-body-parser.d.ts +0 -0
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* AGTree v3.4.3 (build date: Thu, 11 Dec 2025 13:43:19 GMT)
|
|
3
|
-
* (c) 2025 Adguard Software Ltd.
|
|
4
|
-
* Released under the MIT license
|
|
5
|
-
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
|
|
6
|
-
*/
|
|
7
|
-
import { BaseDeserializer } from './base-deserializer.js';
|
|
8
|
-
import { CommentRuleDeserializer } from './comment/comment-rule-deserializer.js';
|
|
9
|
-
import { CosmeticRuleDeserializer } from './cosmetic/cosmetic-rule-deserializer.js';
|
|
10
|
-
import { HostRuleDeserializer } from './network/host-rule-deserializer.js';
|
|
11
|
-
import { NetworkRuleDeserializer } from './network/network-rule-deserializer.js';
|
|
12
|
-
import { EmptyRuleDeserializer } from './empty-rule-deserializer.js';
|
|
13
|
-
import { InvalidRuleDeserializer } from './invalid-rule-deserializer.js';
|
|
14
|
-
import { BinaryTypeMarshallingMap } from '../marshalling-utils/misc/binary-type-common.js';
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* `RuleDeserializer` is responsible for deserializing the rules.
|
|
18
|
-
*
|
|
19
|
-
* It automatically determines the category and syntax of the rule, so you can pass any kind of rule to it.
|
|
20
|
-
*/
|
|
21
|
-
class RuleDeserializer extends BaseDeserializer {
|
|
22
|
-
/**
|
|
23
|
-
* Deserializes a rule node from binary format.
|
|
24
|
-
*
|
|
25
|
-
* @param buffer ByteBuffer for reading binary data.
|
|
26
|
-
* @param node Destination node.
|
|
27
|
-
*/
|
|
28
|
-
static deserialize(buffer, node) {
|
|
29
|
-
// lookup instead of storing +1 byte
|
|
30
|
-
const type = buffer.peekUint8();
|
|
31
|
-
switch (type) {
|
|
32
|
-
case BinaryTypeMarshallingMap.AgentRuleNode:
|
|
33
|
-
case BinaryTypeMarshallingMap.HintRuleNode:
|
|
34
|
-
case BinaryTypeMarshallingMap.PreProcessorCommentRuleNode:
|
|
35
|
-
case BinaryTypeMarshallingMap.MetadataCommentRuleNode:
|
|
36
|
-
case BinaryTypeMarshallingMap.ConfigCommentRuleNode:
|
|
37
|
-
case BinaryTypeMarshallingMap.CommentRuleNode:
|
|
38
|
-
CommentRuleDeserializer.deserialize(buffer, node);
|
|
39
|
-
break;
|
|
40
|
-
case BinaryTypeMarshallingMap.ElementHidingRule:
|
|
41
|
-
case BinaryTypeMarshallingMap.CssInjectionRule:
|
|
42
|
-
case BinaryTypeMarshallingMap.ScriptletInjectionRule:
|
|
43
|
-
case BinaryTypeMarshallingMap.HtmlFilteringRule:
|
|
44
|
-
case BinaryTypeMarshallingMap.JsInjectionRule:
|
|
45
|
-
CosmeticRuleDeserializer.deserialize(buffer, node);
|
|
46
|
-
break;
|
|
47
|
-
case BinaryTypeMarshallingMap.NetworkRuleNode:
|
|
48
|
-
NetworkRuleDeserializer.deserialize(buffer, node);
|
|
49
|
-
break;
|
|
50
|
-
case BinaryTypeMarshallingMap.HostRuleNode:
|
|
51
|
-
HostRuleDeserializer.deserialize(buffer, node);
|
|
52
|
-
break;
|
|
53
|
-
case BinaryTypeMarshallingMap.EmptyRule:
|
|
54
|
-
EmptyRuleDeserializer.deserialize(buffer, node);
|
|
55
|
-
break;
|
|
56
|
-
case BinaryTypeMarshallingMap.InvalidRule:
|
|
57
|
-
InvalidRuleDeserializer.deserialize(buffer, node);
|
|
58
|
-
break;
|
|
59
|
-
default:
|
|
60
|
-
throw new Error('Unknown rule category');
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export { RuleDeserializer };
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* AGTree v3.4.3 (build date: Thu, 11 Dec 2025 13:43:19 GMT)
|
|
3
|
-
* (c) 2025 Adguard Software Ltd.
|
|
4
|
-
* Released under the MIT license
|
|
5
|
-
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
|
|
6
|
-
*/
|
|
7
|
-
import { getSyntaxSerializationMap } from '../marshalling-utils/syntax-serialization-map.js';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Value map for binary deserialization. This helps to reduce the size of the serialized data,
|
|
11
|
-
* as it allows us to use a single byte to represent frequently used values.
|
|
12
|
-
*/
|
|
13
|
-
let syntaxDeserializationMap;
|
|
14
|
-
const getSyntaxDeserializationMap = () => {
|
|
15
|
-
if (!syntaxDeserializationMap) {
|
|
16
|
-
syntaxDeserializationMap = new Map(Array.from(getSyntaxSerializationMap(), ([key, value]) => [value, key]));
|
|
17
|
-
}
|
|
18
|
-
return syntaxDeserializationMap;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export { getSyntaxDeserializationMap };
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* AGTree v3.4.3 (build date: Thu, 11 Dec 2025 13:43:19 GMT)
|
|
3
|
-
* (c) 2025 Adguard Software Ltd.
|
|
4
|
-
* Released under the MIT license
|
|
5
|
-
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Property map for binary serialization. This helps to reduce the size of the serialized data,
|
|
9
|
-
* as it allows us to use a single byte to represent a property.
|
|
10
|
-
*
|
|
11
|
-
* ! IMPORTANT: If you change values here, please update the {@link BINARY_SCHEMA_VERSION}!
|
|
12
|
-
*
|
|
13
|
-
* @note Only 256 values can be represented this way.
|
|
14
|
-
*/
|
|
15
|
-
const AgentCommentMarshallingMap = {
|
|
16
|
-
Children: 1,
|
|
17
|
-
Start: 2,
|
|
18
|
-
End: 3,
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export { AgentCommentMarshallingMap };
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* AGTree v3.4.3 (build date: Thu, 11 Dec 2025 13:43:19 GMT)
|
|
3
|
-
* (c) 2025 Adguard Software Ltd.
|
|
4
|
-
* Released under the MIT license
|
|
5
|
-
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Property map for binary serialization. This helps to reduce the size of the serialized data,
|
|
9
|
-
* as it allows us to use a single byte to represent a property.
|
|
10
|
-
*
|
|
11
|
-
* ! IMPORTANT: If you change values here, please update the {@link BINARY_SCHEMA_VERSION}!
|
|
12
|
-
*
|
|
13
|
-
* @note Only 256 values can be represented this way.
|
|
14
|
-
*/
|
|
15
|
-
const AgentNodeMarshallingMap = {
|
|
16
|
-
Adblock: 1,
|
|
17
|
-
Version: 2,
|
|
18
|
-
Start: 3,
|
|
19
|
-
End: 4,
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* Value map for binary deserialization. This helps to reduce the size of the serialized data,
|
|
23
|
-
* as it allows us to use a single byte to represent frequently used values.
|
|
24
|
-
*/
|
|
25
|
-
const FREQUENT_AGENTS_DESERIALIZATION_MAP = new Map([
|
|
26
|
-
// AdGuard
|
|
27
|
-
[0, 'AdGuard'],
|
|
28
|
-
[1, 'ADG'],
|
|
29
|
-
// uBlock Origin
|
|
30
|
-
[2, 'uBlock Origin'],
|
|
31
|
-
[3, 'uBlock'],
|
|
32
|
-
[4, 'uBO'],
|
|
33
|
-
// Adblock Plus
|
|
34
|
-
[5, 'Adblock Plus'],
|
|
35
|
-
[6, 'AdblockPlus'],
|
|
36
|
-
[7, 'ABP'],
|
|
37
|
-
[8, 'AdBlock'],
|
|
38
|
-
]);
|
|
39
|
-
|
|
40
|
-
export { AgentNodeMarshallingMap, FREQUENT_AGENTS_DESERIALIZATION_MAP };
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* AGTree v3.4.3 (build date: Thu, 11 Dec 2025 13:43:19 GMT)
|
|
3
|
-
* (c) 2025 Adguard Software Ltd.
|
|
4
|
-
* Released under the MIT license
|
|
5
|
-
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Property map for binary serialization. This helps to reduce the size of the serialized data,
|
|
9
|
-
* as it allows us to use a single byte to represent a property.
|
|
10
|
-
*
|
|
11
|
-
* ! IMPORTANT: If you change values here, please update the {@link BINARY_SCHEMA_VERSION}!
|
|
12
|
-
*
|
|
13
|
-
* @note Only 256 values can be represented this way.
|
|
14
|
-
*/
|
|
15
|
-
const ConfigCommentRuleMarshallingMap = {
|
|
16
|
-
Marker: 1,
|
|
17
|
-
Command: 2,
|
|
18
|
-
Params: 3,
|
|
19
|
-
Comment: 4,
|
|
20
|
-
Start: 5,
|
|
21
|
-
End: 6,
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* Property map for binary serialization. This helps to reduce the size of the serialized data,
|
|
25
|
-
* as it allows us to use a single byte to represent a property.
|
|
26
|
-
*
|
|
27
|
-
* ! IMPORTANT: If you change values here, please update the {@link BINARY_SCHEMA_VERSION}!
|
|
28
|
-
*
|
|
29
|
-
* @note Only 256 values can be represented this way.
|
|
30
|
-
*/
|
|
31
|
-
const ConfigNodeMarshallingMap = {
|
|
32
|
-
Value: 1,
|
|
33
|
-
Start: 2,
|
|
34
|
-
End: 3,
|
|
35
|
-
};
|
|
36
|
-
/**
|
|
37
|
-
* Value map for binary serialization. This helps to reduce the size of the serialized data,
|
|
38
|
-
* as it allows us to use a single byte to represent frequently used values.
|
|
39
|
-
*
|
|
40
|
-
* ! IMPORTANT: If you change values here, please update the {@link BINARY_SCHEMA_VERSION}!
|
|
41
|
-
*
|
|
42
|
-
* @note Only 256 values can be represented this way.
|
|
43
|
-
*
|
|
44
|
-
* @see {@link https://github.com/AdguardTeam/AGLint/blob/master/src/linter/inline-config.ts}
|
|
45
|
-
*/
|
|
46
|
-
const FREQUENT_COMMANDS_SERIALIZATION_MAP = new Map([
|
|
47
|
-
['aglint', 0],
|
|
48
|
-
['aglint-disable', 1],
|
|
49
|
-
['aglint-enable', 2],
|
|
50
|
-
['aglint-disable-next-line', 3],
|
|
51
|
-
['aglint-enable-next-line', 4],
|
|
52
|
-
]);
|
|
53
|
-
|
|
54
|
-
export { ConfigCommentRuleMarshallingMap, ConfigNodeMarshallingMap, FREQUENT_COMMANDS_SERIALIZATION_MAP };
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* AGTree v3.4.3 (build date: Thu, 11 Dec 2025 13:43:19 GMT)
|
|
3
|
-
* (c) 2025 Adguard Software Ltd.
|
|
4
|
-
* Released under the MIT license
|
|
5
|
-
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Property map for binary serialization. This helps to reduce the size of the serialized data,
|
|
9
|
-
* as it allows us to use a single byte to represent a property.
|
|
10
|
-
*
|
|
11
|
-
* ! IMPORTANT: If you change values here, please update the {@link BINARY_SCHEMA_VERSION}!
|
|
12
|
-
*
|
|
13
|
-
* @note Only 256 values can be represented this way.
|
|
14
|
-
*/
|
|
15
|
-
const HintCommentMarshallingMap = {
|
|
16
|
-
Syntax: 1,
|
|
17
|
-
Children: 2,
|
|
18
|
-
Start: 3,
|
|
19
|
-
End: 4,
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export { HintCommentMarshallingMap };
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* AGTree v3.4.3 (build date: Thu, 11 Dec 2025 13:43:19 GMT)
|
|
3
|
-
* (c) 2025 Adguard Software Ltd.
|
|
4
|
-
* Released under the MIT license
|
|
5
|
-
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Property map for binary serialization. This helps to reduce the size of the serialized data,
|
|
9
|
-
* as it allows us to use a single byte to represent a property.
|
|
10
|
-
*
|
|
11
|
-
* ! IMPORTANT: If you change values here, please update the {@link BINARY_SCHEMA_VERSION}!
|
|
12
|
-
*
|
|
13
|
-
* @note Only 256 values can be represented this way.
|
|
14
|
-
*/
|
|
15
|
-
const HintNodeMarshallingMap = {
|
|
16
|
-
Name: 1,
|
|
17
|
-
Params: 2,
|
|
18
|
-
Start: 3,
|
|
19
|
-
End: 4,
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* Value map for binary serialization. This helps to reduce the size of the serialized data,
|
|
23
|
-
* as it allows us to use a single byte to represent frequently used values.
|
|
24
|
-
*
|
|
25
|
-
* ! IMPORTANT: If you change values here, please update the {@link BINARY_SCHEMA_VERSION}!
|
|
26
|
-
*
|
|
27
|
-
* @note Only 256 values can be represented this way.
|
|
28
|
-
*/
|
|
29
|
-
const FREQUENT_HINTS_SERIALIZATION_MAP = new Map([
|
|
30
|
-
['NOT_OPTIMIZED', 0],
|
|
31
|
-
['PLATFORM', 1],
|
|
32
|
-
['NOT_PLATFORM', 2],
|
|
33
|
-
]);
|
|
34
|
-
/**
|
|
35
|
-
* Value map for binary serialization. This helps to reduce the size of the serialized data,
|
|
36
|
-
* as it allows us to use a single byte to represent frequently used values.
|
|
37
|
-
*
|
|
38
|
-
* ! IMPORTANT: If you change values here, please update the {@link BINARY_SCHEMA_VERSION}!
|
|
39
|
-
*
|
|
40
|
-
* @note Only 256 values can be represented this way.
|
|
41
|
-
*/
|
|
42
|
-
const FREQUENT_PLATFORMS_SERIALIZATION_MAP = new Map([
|
|
43
|
-
['windows', 0],
|
|
44
|
-
['mac', 1],
|
|
45
|
-
['android', 2],
|
|
46
|
-
['ios', 3],
|
|
47
|
-
['ext_chromium', 4],
|
|
48
|
-
['ext_ff', 5],
|
|
49
|
-
['ext_edge', 6],
|
|
50
|
-
['ext_opera', 7],
|
|
51
|
-
['ext_safari', 8],
|
|
52
|
-
['ext_android_cb', 9],
|
|
53
|
-
['ext_ublock', 10],
|
|
54
|
-
]);
|
|
55
|
-
|
|
56
|
-
export { FREQUENT_HINTS_SERIALIZATION_MAP, FREQUENT_PLATFORMS_SERIALIZATION_MAP, HintNodeMarshallingMap };
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* AGTree v3.4.3 (build date: Thu, 11 Dec 2025 13:43:19 GMT)
|
|
3
|
-
* (c) 2025 Adguard Software Ltd.
|
|
4
|
-
* Released under the MIT license
|
|
5
|
-
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Property map for binary serialization. This helps to reduce the size of the serialized data,
|
|
9
|
-
* as it allows us to use a single byte to represent a property.
|
|
10
|
-
*
|
|
11
|
-
* ! IMPORTANT: If you change values here, please update the {@link BINARY_SCHEMA_VERSION}!
|
|
12
|
-
*
|
|
13
|
-
* @note Only 256 values can be represented this way.
|
|
14
|
-
*/
|
|
15
|
-
const MetadataCommentMarshallingMap = {
|
|
16
|
-
Marker: 1,
|
|
17
|
-
Header: 2,
|
|
18
|
-
Value: 3,
|
|
19
|
-
Start: 4,
|
|
20
|
-
End: 5,
|
|
21
|
-
};
|
|
22
|
-
/**
|
|
23
|
-
* Value map for binary deserialization. This helps to reduce the size of the serialized data,
|
|
24
|
-
* as it allows us to use a single byte to represent frequently used values.
|
|
25
|
-
*/
|
|
26
|
-
const FREQUENT_HEADERS_DESERIALIZATION_MAP = new Map([
|
|
27
|
-
[1, 'Checksum'],
|
|
28
|
-
[2, 'Description'],
|
|
29
|
-
[3, 'Expires'],
|
|
30
|
-
[4, 'Homepage'],
|
|
31
|
-
[5, 'Last Modified'],
|
|
32
|
-
[6, 'LastModified'],
|
|
33
|
-
[7, 'Licence'],
|
|
34
|
-
[8, 'License'],
|
|
35
|
-
[9, 'Time Updated'],
|
|
36
|
-
[10, 'TimeUpdated'],
|
|
37
|
-
[11, 'Version'],
|
|
38
|
-
[12, 'Title'],
|
|
39
|
-
]);
|
|
40
|
-
|
|
41
|
-
export { FREQUENT_HEADERS_DESERIALIZATION_MAP, MetadataCommentMarshallingMap };
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* AGTree v3.4.3 (build date: Thu, 11 Dec 2025 13:43:19 GMT)
|
|
3
|
-
* (c) 2025 Adguard Software Ltd.
|
|
4
|
-
* Released under the MIT license
|
|
5
|
-
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Property map for binary serialization. This helps to reduce the size of the serialized data,
|
|
9
|
-
* as it allows us to use a single byte to represent a property.
|
|
10
|
-
*
|
|
11
|
-
* ! IMPORTANT: If you change values here, please update the {@link BINARY_SCHEMA_VERSION}!
|
|
12
|
-
*
|
|
13
|
-
* @note Only 256 values can be represented this way.
|
|
14
|
-
*/
|
|
15
|
-
const PreProcessorRuleMarshallingMap = {
|
|
16
|
-
Name: 1,
|
|
17
|
-
Params: 2,
|
|
18
|
-
Syntax: 3,
|
|
19
|
-
Start: 4,
|
|
20
|
-
End: 5,
|
|
21
|
-
};
|
|
22
|
-
/**
|
|
23
|
-
* Value map for binary serialization. This helps to reduce the size of the serialized data,
|
|
24
|
-
* as it allows us to use a single byte to represent frequently used values.
|
|
25
|
-
*
|
|
26
|
-
* ! IMPORTANT: If you change values here, please update the {@link BINARY_SCHEMA_VERSION}!
|
|
27
|
-
*
|
|
28
|
-
* @note Only 256 values can be represented this way.
|
|
29
|
-
*
|
|
30
|
-
* @see {@link https://adguard.com/kb/general/ad-filtering/create-own-filters/#preprocessor-directives}
|
|
31
|
-
* @see {@link https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#pre-parsing-directives}
|
|
32
|
-
*/
|
|
33
|
-
const FREQUENT_DIRECTIVES_SERIALIZATION_MAP = new Map([
|
|
34
|
-
['if', 0],
|
|
35
|
-
['else', 1],
|
|
36
|
-
['endif', 2],
|
|
37
|
-
['include', 3],
|
|
38
|
-
['safari_cb_affinity', 4],
|
|
39
|
-
]);
|
|
40
|
-
/**
|
|
41
|
-
* Value map for binary serialization. This helps to reduce the size of the serialized data,
|
|
42
|
-
* as it allows us to use a single byte to represent frequently used values.
|
|
43
|
-
*
|
|
44
|
-
* ! IMPORTANT: If you change values here, please update the {@link BINARY_SCHEMA_VERSION}!
|
|
45
|
-
*
|
|
46
|
-
* @note Only 256 values can be represented this way.
|
|
47
|
-
*/
|
|
48
|
-
const FREQUENT_PARAMS_SERIALIZATION_MAP = new Map([
|
|
49
|
-
// safari_cb_affinity parameters
|
|
50
|
-
['general', 0],
|
|
51
|
-
['privacy', 1],
|
|
52
|
-
['social', 2],
|
|
53
|
-
['security', 3],
|
|
54
|
-
['other', 4],
|
|
55
|
-
['custom', 5],
|
|
56
|
-
['all', 6],
|
|
57
|
-
]);
|
|
58
|
-
|
|
59
|
-
export { FREQUENT_DIRECTIVES_SERIALIZATION_MAP, FREQUENT_PARAMS_SERIALIZATION_MAP, PreProcessorRuleMarshallingMap };
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* AGTree v3.4.3 (build date: Thu, 11 Dec 2025 13:43:19 GMT)
|
|
3
|
-
* (c) 2025 Adguard Software Ltd.
|
|
4
|
-
* Released under the MIT license
|
|
5
|
-
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Property map for binary serialization. This helps to reduce the size of the serialized data,
|
|
9
|
-
* as it allows us to use a single byte to represent a property.
|
|
10
|
-
*
|
|
11
|
-
* ! IMPORTANT: If you change values here, please update the {@link BINARY_SCHEMA_VERSION}!
|
|
12
|
-
*
|
|
13
|
-
* @note Only 256 values can be represented this way.
|
|
14
|
-
*/
|
|
15
|
-
const SimpleCommentMarshallingMap = {
|
|
16
|
-
Marker: 1,
|
|
17
|
-
Text: 2,
|
|
18
|
-
Start: 3,
|
|
19
|
-
End: 4,
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export { SimpleCommentMarshallingMap };
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* AGTree v3.4.3 (build date: Thu, 11 Dec 2025 13:43:19 GMT)
|
|
3
|
-
* (c) 2025 Adguard Software Ltd.
|
|
4
|
-
* Released under the MIT license
|
|
5
|
-
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Property map for binary serialization. This helps to reduce the size of the serialized data,
|
|
9
|
-
* as it allows us to use a single byte to represent a property.
|
|
10
|
-
*
|
|
11
|
-
* ! IMPORTANT: If you change values here, please update the {@link BINARY_SCHEMA_VERSION}!
|
|
12
|
-
*
|
|
13
|
-
* @note Only 256 values can be represented this way.
|
|
14
|
-
*/
|
|
15
|
-
const AbpSnippetBodyMarshallingMap = {
|
|
16
|
-
Children: 1,
|
|
17
|
-
Start: 2,
|
|
18
|
-
End: 3,
|
|
19
|
-
};
|
|
20
|
-
/**
|
|
21
|
-
* Value map for binary serialization. This helps to reduce the size of the serialized data,
|
|
22
|
-
* as it allows us to use a single byte to represent frequently used values.
|
|
23
|
-
*
|
|
24
|
-
* ! IMPORTANT: If you change values here, please update the {@link BINARY_SCHEMA_VERSION}!
|
|
25
|
-
*
|
|
26
|
-
* @note Only 256 values can be represented this way.
|
|
27
|
-
*/
|
|
28
|
-
// TODO: Update this map with the actual values
|
|
29
|
-
const FREQUENT_ABP_SNIPPET_ARGS_SERIALIZATION_MAP = new Map([
|
|
30
|
-
['abort-current-inline-script', 0],
|
|
31
|
-
['abort-on-property-read', 1],
|
|
32
|
-
['abort-on-property-write', 2],
|
|
33
|
-
['json-prune', 3],
|
|
34
|
-
['log', 4],
|
|
35
|
-
['prevent-listener', 5],
|
|
36
|
-
['cookie-remover', 6],
|
|
37
|
-
['override-property-read', 7],
|
|
38
|
-
['abort-on-iframe-property-read', 8],
|
|
39
|
-
['abort-on-iframe-property-write', 9],
|
|
40
|
-
['freeze-element', 10],
|
|
41
|
-
['json-override', 11],
|
|
42
|
-
['simulate-mouse-event', 12],
|
|
43
|
-
['strip-fetch-query-parameter', 13],
|
|
44
|
-
['hide-if-contains', 14],
|
|
45
|
-
['hide-if-contains-image', 15],
|
|
46
|
-
['hide-if-contains-image-hash', 16],
|
|
47
|
-
['hide-if-contains-similar-text', 17],
|
|
48
|
-
['hide-if-contains-visible-text', 18],
|
|
49
|
-
['hide-if-contains-and-matches-style', 19],
|
|
50
|
-
['hide-if-graph-matches', 20],
|
|
51
|
-
['hide-if-has-and-matches-style', 21],
|
|
52
|
-
['hide-if-labelled-by', 22],
|
|
53
|
-
['hide-if-matches-xpath', 23],
|
|
54
|
-
['hide-if-matches-computed-xpath', 24],
|
|
55
|
-
['hide-if-shadow-contains', 25],
|
|
56
|
-
['debug', 26],
|
|
57
|
-
['trace', 27],
|
|
58
|
-
['race', 28],
|
|
59
|
-
]);
|
|
60
|
-
|
|
61
|
-
export { AbpSnippetBodyMarshallingMap, FREQUENT_ABP_SNIPPET_ARGS_SERIALIZATION_MAP };
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* AGTree v3.4.3 (build date: Thu, 11 Dec 2025 13:43:19 GMT)
|
|
3
|
-
* (c) 2025 Adguard Software Ltd.
|
|
4
|
-
* Released under the MIT license
|
|
5
|
-
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Value map for binary serialization. This helps to reduce the size of the serialized data,
|
|
9
|
-
* as it allows us to use a single byte to represent frequently used values.
|
|
10
|
-
*
|
|
11
|
-
* ! IMPORTANT: If you change values here, please update the {@link BINARY_SCHEMA_VERSION}!
|
|
12
|
-
*
|
|
13
|
-
* @note Only 256 values can be represented this way.
|
|
14
|
-
*/
|
|
15
|
-
// TODO: Update this map with the actual values
|
|
16
|
-
const FREQUENT_ADG_SCRIPTLET_ARGS_SERIALIZATION_MAP = new Map([
|
|
17
|
-
['abort-current-inline-script', 0],
|
|
18
|
-
['abort-on-property-read', 1],
|
|
19
|
-
['abort-on-property-write', 2],
|
|
20
|
-
['abort-on-stack-trace', 3],
|
|
21
|
-
['adjust-setInterval', 4],
|
|
22
|
-
['adjust-setTimeout', 5],
|
|
23
|
-
['close-window', 6],
|
|
24
|
-
['debug-current-inline-script', 7],
|
|
25
|
-
['debug-on-property-read', 8],
|
|
26
|
-
['debug-on-property-write', 9],
|
|
27
|
-
['dir-string', 10],
|
|
28
|
-
['disable-newtab-links', 11],
|
|
29
|
-
['evaldata-prune', 12],
|
|
30
|
-
['json-prune', 13],
|
|
31
|
-
['log', 14],
|
|
32
|
-
['log-addEventListener', 15],
|
|
33
|
-
['log-eval', 16],
|
|
34
|
-
['log-on-stack-trace', 17],
|
|
35
|
-
['m3u-prune', 18],
|
|
36
|
-
['noeval', 19],
|
|
37
|
-
['nowebrtc', 20],
|
|
38
|
-
['no-topics', 21],
|
|
39
|
-
['prevent-addEventListener', 22],
|
|
40
|
-
['prevent-adfly', 23],
|
|
41
|
-
['prevent-bab', 24],
|
|
42
|
-
['prevent-eval-if', 25],
|
|
43
|
-
['prevent-fab-3.2.0', 26],
|
|
44
|
-
['prevent-fetch', 27],
|
|
45
|
-
['prevent-xhr', 28],
|
|
46
|
-
['prevent-popads-net', 29],
|
|
47
|
-
['prevent-refresh', 30],
|
|
48
|
-
['prevent-requestAnimationFrame', 31],
|
|
49
|
-
['prevent-setInterval', 32],
|
|
50
|
-
['prevent-setTimeout', 33],
|
|
51
|
-
['prevent-window-open', 34],
|
|
52
|
-
['remove-attr', 35],
|
|
53
|
-
['remove-class', 36],
|
|
54
|
-
['remove-cookie', 37],
|
|
55
|
-
['remove-node-text', 38],
|
|
56
|
-
['set-attr', 39],
|
|
57
|
-
['set-constant', 40],
|
|
58
|
-
['set-cookie', 41],
|
|
59
|
-
['set-cookie-reload', 42],
|
|
60
|
-
['set-local-storage-item', 43],
|
|
61
|
-
['set-popads-dummy', 44],
|
|
62
|
-
['set-session-storage-item', 45],
|
|
63
|
-
['xml-prune', 46],
|
|
64
|
-
]);
|
|
65
|
-
|
|
66
|
-
export { FREQUENT_ADG_SCRIPTLET_ARGS_SERIALIZATION_MAP };
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* AGTree v3.4.3 (build date: Thu, 11 Dec 2025 13:43:19 GMT)
|
|
3
|
-
* (c) 2025 Adguard Software Ltd.
|
|
4
|
-
* Released under the MIT license
|
|
5
|
-
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Property map for binary serialization. This helps to reduce the size of the serialized data,
|
|
9
|
-
* as it allows us to use a single byte to represent a property.
|
|
10
|
-
*
|
|
11
|
-
* ! IMPORTANT: If you change values here, please update the {@link BINARY_SCHEMA_VERSION}!
|
|
12
|
-
*
|
|
13
|
-
* @note Only 256 values can be represented this way.
|
|
14
|
-
*/
|
|
15
|
-
const CssInjectionRuleMarshallingMap = {
|
|
16
|
-
SelectorList: 1,
|
|
17
|
-
DeclarationList: 2,
|
|
18
|
-
MediaQueryList: 3,
|
|
19
|
-
Remove: 4,
|
|
20
|
-
Start: 5,
|
|
21
|
-
End: 6,
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export { CssInjectionRuleMarshallingMap };
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* AGTree v3.4.3 (build date: Thu, 11 Dec 2025 13:43:19 GMT)
|
|
3
|
-
* (c) 2025 Adguard Software Ltd.
|
|
4
|
-
* Released under the MIT license
|
|
5
|
-
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Property map for binary serialization. This helps to reduce the size of the serialized data,
|
|
9
|
-
* as it allows us to use a single byte to represent a property.
|
|
10
|
-
*
|
|
11
|
-
* ! IMPORTANT: If you change values here, please update the {@link BINARY_SCHEMA_VERSION}
|
|
12
|
-
*
|
|
13
|
-
* @note Only 256 values can be represented this way.
|
|
14
|
-
*/
|
|
15
|
-
const ElementHidingRuleMarshallingMap = {
|
|
16
|
-
SelectorList: 1,
|
|
17
|
-
Start: 2,
|
|
18
|
-
End: 3,
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export { ElementHidingRuleMarshallingMap };
|