RequestPolicyContinued / requestpolicy

a web browser extension that gives you control over cross-site requests. Available for XUL/XPCOM-based browsers.
https://github.com/RequestPolicyContinued/requestpolicy/wiki
Other
252 stars 35 forks source link

FeatReq: Rewrite target hostnames in DOM #764

Closed mk-pmb closed 8 years ago

mk-pmb commented 8 years ago

When I try to read this blog, it tries to load Angular.js from ajax.googleapis.com. I'd have to allow that in order for my Firefox to be served my cache's redirect to ajax.google.webcache.infra, and then allow ajax.google.webcache.infra. Could there be an easy way to teach RPC about my redirects and have it replace them on the page? That would kill two birds with one stone, save a lot of clicks in RPC, and save quite some convincing of Firefox to not protect me against my trusted cache's "attack" on those websites whenever they invent a new defense.

I found

In comparison, rewriting domains in the usual [1] DOM locations seems a smaller task with broader range of application, as my web cache can do some other cool tricks as well. Another benefit of the redirect approach over the CDN emulation addons is to help NoScript discern the cached and live versions. Once RPC translates domains from a user-defined dictionary (wildcards are a bonus), solutions for some of the namespace unification issues can be supplied by 3rd party tools easily as a side effect.

If the domain rewriting is extended to whatever part of RPC checks and asks me "This webpage has asked to redirect to…", it could even harmonize URLs that I click in mail or forums.

mk-pmb commented 8 years ago

Next stages of feature creep:

myrdd commented 8 years ago

I'd be cautious with changing the URLs in the DOM. There might be multiple side effects; even more than I'll mention now.

I'd have to allow that in order for my Firefox to be served my cache's redirect to ajax.google.webcache.infra, and then allow ajax.google.webcache.infra.

Really? I'd suppose RP doesn't even recognize the content finally came from the webcache, no? I'm assuming your webcache is implemented like a proxy.

In any case, I won't implement "DOM URL rewrites" in RP. If you choose to go that path, there should be another add-on (which seems not to exist yet) for it.

Maybe HTTPS-Everywhere is another approach you could try. It supports custom rulesets. However, RP still will see the requests to ajax.googleapis.com.

mk-pmb commented 8 years ago

Thanks for reminding me about script safety on my webcache! My NoScript can trust ajax.google.webcache.infra since it will serve only a reviewed subset of Google's real CDN. As for RPC, I shall search the issues for how to get more precise rules than *.webcache.infra, although I can't currently think of a risk that isn't blocked by either my NoScript or my webcache. (It won't easily GET tracking pixels.) ABE rules are configured to allow injection and click-stealing "attacks" from my cache.

In any case, I won't implement "DOM URL rewrites" in RP. If you choose to go that path, there should be another add-on (which seems not to exist yet) for it.

Ok, then I'll start developing one. :-)

myrdd commented 8 years ago

As for RPC, I shall search the issues for how to get more precise rules than *.webcache.infra,

You can do it manually. As for the menu, the issue is https://github.com/RequestPolicyContinued/requestpolicy/issues/474.

Ok, then I'll start developing one. :-)

Good luck :)

mk-pmb commented 8 years ago

Thanks for that hint! I thus discovered path-based rules and it looks like they might help a lot.