Things like uBO and Doogie use fast lookup maps to check URL pieces
Doogie, at least, uses a type of linked list to check for certain pieces of URLs separated by wildcards (like regex wildcards but way more limited) as mentioned in the spec (see cheatsheet)
While high performance, maybe we could make it better compiling to static WASM commands (i.e. chained sets of br_ifs and br_tables)
Get a benefit of the fact that URLs are regular ASCII and therefore byte arrays which WASM loves can be used
Would need to be able to compile to WASM at runtime, which shouldn't be too bad
What language to write the filter-list-to-wasm in? Could reuse asmble's WASM compiler since it's in Kotlin and therefore can compile to WASM or JS
Trying to think how this could effect cosmetic filters. One cool approach may be to compile html5ever to WASM and then use that to help do selector matching (using selectors component) which would be awesome and maybe could beat in-browser ...well, wait, a MutationObserver which is used for filter lists has DOM nodes already, so browser is already putting in work
br_if
s andbr_table
s)MutationObserver
which is used for filter lists has DOM nodes already, so browser is already putting in work