-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to make context-sensitive URL filtering #95
Comments
The ideal way to do it would be to have the UrlRelativeEvaluate trait accept the three parameters (the tag, attribute, and URL) and just have it impl for the one-argument and three-argument closures. Unfortunately, that would be a breaking change. So... Let's add another version (UrlRelativeEvaluateWithTag). The non-WithTag version will be kept around for back-compat until 2.0. |
Could this be generalized to |
Now that you bring it up ... that's a good point. Your use case does require you to be able to preprocess all of the URLs, not just some of them. So, yeah, this is completely separate from relative URL evaluation. So, there shouldn't be any deprecation or anything. Just a completely separate hook for URL postprocessing (which would run after relative URL evaluation) that is what you want to use for your camo links. |
UrlRelativeEvaluate
is not aware of what kind of URL it is filtering. I need to rewrite image URLs<img src>
differently than regular<a href>
links.Ideally I'd like to also filter absolute image URLs in order to force all images to load via a caching/anonymizing server for privacy. This is somewhat related to #59, but instead of blocking of image URLs I'd like to change them (and only image URLs, links aren't a problem for my use case).
A callback function that gets name of element and attribute would work for me.
The text was updated successfully, but these errors were encountered: