@adguard/agtree
Version:
Tool set for working with adblock filter lists
67 lines (65 loc) • 2.11 kB
JavaScript
/*
* AGTree v3.2.1 (build date: Wed, 28 May 2025 13:36:39 GMT)
* (c) 2025 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* Value map for binary serialization. This helps to reduce the size of the serialized data,
* as it allows us to use a single byte to represent frequently used values.
*
* ! IMPORTANT: If you change values here, please update the {@link BINARY_SCHEMA_VERSION}!
*
* @note Only 256 values can be represented this way.
*/
// TODO: Update this map with the actual values
const FREQUENT_ADG_SCRIPTLET_ARGS_SERIALIZATION_MAP = new Map([
['abort-current-inline-script', 0],
['abort-on-property-read', 1],
['abort-on-property-write', 2],
['abort-on-stack-trace', 3],
['adjust-setInterval', 4],
['adjust-setTimeout', 5],
['close-window', 6],
['debug-current-inline-script', 7],
['debug-on-property-read', 8],
['debug-on-property-write', 9],
['dir-string', 10],
['disable-newtab-links', 11],
['evaldata-prune', 12],
['json-prune', 13],
['log', 14],
['log-addEventListener', 15],
['log-eval', 16],
['log-on-stack-trace', 17],
['m3u-prune', 18],
['noeval', 19],
['nowebrtc', 20],
['no-topics', 21],
['prevent-addEventListener', 22],
['prevent-adfly', 23],
['prevent-bab', 24],
['prevent-eval-if', 25],
['prevent-fab-3.2.0', 26],
['prevent-fetch', 27],
['prevent-xhr', 28],
['prevent-popads-net', 29],
['prevent-refresh', 30],
['prevent-requestAnimationFrame', 31],
['prevent-setInterval', 32],
['prevent-setTimeout', 33],
['prevent-window-open', 34],
['remove-attr', 35],
['remove-class', 36],
['remove-cookie', 37],
['remove-node-text', 38],
['set-attr', 39],
['set-constant', 40],
['set-cookie', 41],
['set-cookie-reload', 42],
['set-local-storage-item', 43],
['set-popads-dummy', 44],
['set-session-storage-item', 45],
['xml-prune', 46],
]);
export { FREQUENT_ADG_SCRIPTLET_ARGS_SERIALIZATION_MAP };