Closed OkanEsen closed 6 years ago
I built on your PRs but extended the functionality quite a bit.
I added variables for item, frame, and tab URL. I figured it would be more useful to tag the files with domain.com, rather than like cdn1.domain.com, img.domain.com, etc.
I also extended the expression syntax so variables can take a parameter like: ${itemUrl[hostname]}
, its a little more verbose but still easier than having 3 separate sets of URL parameters.
The searchParams are accessed with dot notation like so: ${itemUrl[search.q]}
instead of having a filter to unpack them.
The cleanSplit function was replaced with a tokenizer that doesn't split regexes. The method you had of matching the known filters did work, but it had a side effect of not reporting an error when a filter was unknown.
I didn't realize the URL interface did parsing, so after seeing your PR I was able to replace some parsing logic with uses of URL.
Oh yeah, for sure, I like your approach much better and replacing the cleanSplit
function with a tokenizer is much better imo. Thanks for your hard work, appreciate it a lot!
Wiki should be updated accordingly.
Here is the new list of variables for the wiki entry:
And for filters: