Search code examples
htmlhyperlinkadblockublock-origin

How to make a link to add a filter list to uBlock Origin?


EasyList has "add it to your ad blocker" links for their various filter lists. When I click on them, my content blocker browser extension prompts me to add the filter list from EasyList. The EasyList website uses links to the subscribe.adblockplus.org domain (which doesn't actually resolve) to accomplish this. I want to make a link for people to easily be able to add my filter list to their content blocker (uBlock Origin in particular).

I've tried using the same link as EasyList, but uBlock Origin doesn't seem to be intercepting navigations to the magical subscribe.adblockplus.org domain, so I just get a "Server Not Found" error. How can I properly construct such a link?


Solution

  • uBlock Origin only allows subscribe URLs on a hardcoded list of domains. https://*.github.io/* is on that list, so you can use a GitHub Pages site to host the page with the URL. (alternatively, you could just ask to be added to the list)

    On an allowed domain, you can make a link to add a filter list like https://subscribe.adblockplus.org/?location=[list URL]&title=[filter list title] (where the URL and title are be URL-encoded), and clicking the link will prompt the user to add the filter list.