4 ms·
Regular expression replaces on content are very fragile. Unfortunately, browsers do not yet provide general request regulation capabilities. Until then, Transce
by Sephr 5y ago
Regular expression replaces on content are very fragile. Unfortunately, browsers do not yet provide general request regulation capabilities. Until then, Transcend Consent Manager's API can solve this much more easily with a more robust request-override based approach:
self.airgap = {
overrides: [{
matcher: '//www.youtube.com/',
override(request) {
request.urls.forEach((input, i) => {
const url = new URL(input, location.href);
if (url.searchParams.has('pp')) {
url.searchParams.delete('pp');
request.urls[i] = url.href;
}
});
}
}]
};
- rasz 5y agoIts true URLSearchParams is a proper blessed way of working with url parameters, but its just my tiny userscript working on a serialized JSON, so either I grep and be done with it, or be forced to actually parse it, traverse huge Object looking for 100 individual URL fields to modify "properly", and stringlify once again. Im good with regex thank you :) >Transcend Consent Manager's API what is that? >request-override based approach the idea is to modify those URLs before they get rendered on the page, this way they get applied :visited style in the first place.
- Sephr 5y ago> what is that? A new consent management tool for website owners. We're currently in closed beta. Learn more here: https://transcend.io/blog/defeating-cookie-banners https://transcend.io/blog/defeating-cookie-banners > the idea is to modify those URLs before they get rendered on the page These overrides are applied before the URLs are rendered on the page or trigger any requests.
- rasz 5y ago>DOM nodes by directly patching the prototypes, methods, and accessors of all global element constructors and DOM tree construction utilities. We can write a patcher which overrides the constructor prototype, which allows us to check if the URL is allowed before the DOM mutation is performed. Now I understand. Your product is aimed at corporations seeking more mature? compliance with privacy laws. Sounds like tough market.