martok / palefill

Inject Polyfills for various web technologies into pages requiring them
https://martok.github.io/palefill/
Mozilla Public License 2.0
79 stars 9 forks source link

Domain Wildcards #6

Closed martok closed 2 years ago

martok commented 2 years ago

Currently not possible: selectors for *.notion.site etc.

Implementation is not as obvious as it might seem because it needs to be fast and work well with the exclusion list, isSiteEnabled is the first fast check for any request.

Since the wildcard is often going to be at the start, reverse-matching (in hierarchy order) might make sense.

martok commented 2 years ago

Interestingly, benchmarks showed that the new version is consistently faster than the old one. I kind of understand why a tree is faster than a linear search (even if the log complexity shouldn't really matter with less than 20 items), but why it is also faster than a x in Set lookup for the early-out domain tests is beyond me.