An old favorite app called "Proxomotron" used to do that. It's still around, and still works, though it's now a bit dated. Unfortunately the developer of this great freeware app passed away some years ago so it's not being updated and is unlikely to ever be, and web specs and ad purveyors have moved on, so the app doesn't work as well as it used to. Still, it's out there, it's very configurable, can run on Linux under Wine, and you can write your own filters. And choose between multiple proxies with it. So still worth a look.