question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support $redirect-urls in adblock

See original GitHub issue

Related to https://github.com/brave/brave-browser/issues/18186. We’ve added support for redirect-url for adblock-rs which will allow us to specify loading a replacement resource over the network. We will restrict this to known safe filter lists (disabled by default).

The intention is to allow resource replacements over the network if there’s an adblock filter match. In other words, the redirect-filter option in a filter rule instructs the browser to load a replacement resource for the matching resource via a URL instead of locally. Example:

google-analytics.js$redirect-url=important,https://pcdn.brave.software/sugarcoat/sugarcoat-analytics-a14946c73def6bdaa93155f58435a82e.min.js

would load the script at https://pcdn.brave.software/sugarcoat/sugarcoat-analytics-a14946c73def6bdaa93155f58435a82e.min.js instead of any script named google-analytics.js.

Notice the pcdn.brave.software domain - the intended usecase is to only load sugarcoated scripts hosted on Private CDN. The only filter lists we will enable redirect-url filter option to be parsed on are Brave-controlled ones, and specifically only Sugarcoat for now.

Sugarcoat is a research project to automatically stub out privacy-invasive API accesses by scripts. For more info: https://github.com/brave-experiments/sugarcoat-pipeline/. Essentially, the sugarcoat pipeline takes in a webpage and gives you sanitized scripts that would have been blocked by a filter list rule but are not because of webcompat reasons i.e. have a corresponding exception rule. The generated sugarcoat rule has an important filter option so as to ensure the resource does get blocked despite the exception rule. We previously tried loading the sugarcoated replacement resources locally but that requires us to ship them in the browser which resulted in some memory-bound machines getting borked (this also has to do with some tech debt in how we load filter lists but in any case, for Sugarcoat to be useful we would need to load many, many replacement scripts).

This feature should have a feature flag so we can turn it off via Griffin, though given that the sugarcoat rules are shipped in the adblock crx component we can just ship a component update which would not require a restart.

Related PRs:

Security/privacy review: https://github.com/brave/security/issues/615

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
stephendonnercommented, Nov 22, 2021

@ShivanKaul when you get a chance, can you please check on the bloomberg.com, bmw.com.au, and virginmobile.ca cases, as I think they’ve changed; thanks!

1reaction
ShivanKaulcommented, Nov 4, 2021

@stephendonner updated the PR test plan and DM’d the DAT file for testing convenience.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to block page redirect to some URL? - Adblock Plus
I want to block such redirect and just stay on that page with some error. ... Could you please help me write a...
Read more >
Redirect Blocker
Redirect Blocker removes the redirections that sites set up to track you, monetize their links, or for their statistics.
Read more >
Use a URL Redirect Checker to bypass ROBERT link ad blocker
Use a URL Redirect Checker to bypass ROBERT link ad blocker. If you have ROBERT set to block ... Retrace which list is...
Read more >
Redirect to rename remote images so as to get around adblock
The problem is that 1/4 of users use ad blockers and their images have URLs like https://example.com/ad-image/ads/1234/500.jpg which read to ad ...
Read more >
How to Block Redirects in Chrome, Firefox, Edge, Safari ...
How to Prevent Redirects in Firefox · Launch the Firefox browser; · Click hamburger menu (☰) and proceed to the “Help” section; ·...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found