Custom adblock filter list
-
I’m giving the internal adblocker another chance and implemented a custom filter list. But I’m quite confused why some rules work, while others don’t. For anyone willing to take a look at this.
-
Enable the internal adblocker and disable any extensions blocking ads
-
Create a text file (e.g. custom.txt) with following content and save it somewhere
[Adblock Plus 2.0] ! Version: ! Title: CustomList ! Last modified: ! Expires: ! Homepage: ! www.reddit.com##.promotedlink www.youtube.com###sections
-
Add your new file to the blocking sources in
vivaldi://settings/privacy/
-
Visit any video on youtube and notice the comments are gone
-
Visit https://www.reddit.com, the promoted links are still there
The question is, why does one rule fail, while the other rule works? The only difference is one is a class, the other an id. Both rules work as expected in ublock origin.
-
-
@luetage Try writing the class rule like this instead:
www.reddit.com##[class="promotedlink"]
I can’t verify if this will work, but that is how I’ve normally written them for my custom filter rules file and they seem to work.
-
@AltCode Doesn’t appear to work. The silly thing is the reddit one is actually part of EasyList, which works on ublock origin, but not in the internal adblocker. So I have to assume this is a Vivaldi problem, but I don’t understand why.
-
@luetage It should support the same as Adblock filters, except I think the Adblock Plus specific filters.
https://adblockplus.org/filter-cheatsheetTry making a basic test case, it might be a bug or simply that the V blocker fails to hide
id
elements. Your rules look correct to me. -
@Pathduck A test case would be
forum.vivaldi.net##.topic-info
, which works… Makes no sense. Going to reddit and inserting a simple css rule in devtools.promotedlink {display: none;}
hides them as expected. So it’s not like I’m getting the element or selector wrong. -
After a restart it works now. Hard to tell what went wrong, but I could have sworn I tried restarting several times before and refreshing the custom list should be enough normally.
-
@luetage I'm not sure what went wrong with your installation, but when I visited reddit,
.promotedlink
was properly blocked with just the built-in EasyList source enabled on the built-in ad blocker. -
@AltCode Yes, but with EasyList alone it still doesn’t work in my case… The custom entry works however. This is definitely too hard for casual users, Vivaldi will have to do something about it.
-
@luetage Agreed - I have added a custom list but it's not something easily done by casual users.
For instance if a user needs to make an exception for a rule that breaks a site, they'll need to whitelist the whole site.
But then again, a user would still need knowledge of using the Devtools to see blocked requests and to find elements to be blocked.
Maybe they could add a user blocklist, loaded but empty by default and allow it to be opened and edited in the OS' default text editor.
-
@Pathduck said in Custom adblock filter list:
Maybe they could add a user blocklist, loaded but empty by default and allow it to be opened and edited in the OS' default text editor.
Having that would certainly streamline the addition of custom filters to Vivaldi (notwithstanding the need to know the filter cheatsheet and how to use the devtools). Though I would think if such a feature were to exist, it would be best to keep the editing within Vivaldi, no external text editor necessary (Vivaldi already has a terrific notes editor after all). Most ad blockers seem to have this anyways (e.g. uBlock has it under "My filters").
It would also be great if this were synced as well. After all, custom filter lists must be manually created and imported for every install of Vivaldi.
-
@Pathduck We can group users
- What is adblock? – …
- Why does Vivaldi not block x? – needs it pre‐configured and isn’t willing to mess with any settings
- Vivaldi doesn’t have x list? – doesn’t know how to find and add filter lists
- This topic (custom block list, element zapping)
Other adblockers have far more lists enabled by default and also available, but disabled and catch groups 2 and 3 with it. Making it easier for group 4 should be the goal additionally, but it’s a minority of users.
-
@luetage and 5. Why y is broken
@Pathduck Can you share an extract (obviously without personal sites) which can I use for understand better?
A post blog with ABP current supported syntax would be very useful.
And even something more informative than "Resource Blocked" in devtools (they could add the actual rule) -
Can you share an extract (obviously without personal sites) which can I use for understand better?
This is what I have:
! Title: Adblock Filters (personal) !! EXCEPTIONS @@||apibay.org^$domain=thepiratebay.org @@||a.exdynsrv.com^$domain=thepiratebay.org @@||forexprostools.com^ !! BLOCKS ||resett.no^$document example.com##h1 example.com##p:style(background-color:red;)
Note that I use it only for testing/examples, this is not active, rules are probably outdated, it's rarely I enable it. Usually I would load the file into a test profile to not interfere with uBO in my regular profile.
Also note that doing any change in the file requires a manual reload by toggling the list off and on again... yeah it's not a great solution.
A post blog with ABP current supported syntax would be very useful.
It's pretty well documented here, but yes some of the more advanced stuff won't work in Vivaldi, you'll just have to test:
https://help.eyeo.com/en/adblockplus/how-to-write-filters
https://adblockplus.org/filter-cheatsheetAnd even something more informative than "Resource Blocked" in devtools (they could add the actual rule)
Yes, this is what I asked about in the other topic. Would be nice to have.
https://forum.vivaldi.net/post/613896 -
Does anyone know which filter syntax is most compatible with the native adblocker?
I too created my own basic list and threw it up on GitHub for my own use. It's small, just some annoyances on a few sites that none of the extensions stop, even uBO. But uBO, AdBlock, and ABP can all kill with their element pickers.
So I have been doing that, then going into the extensions' lists of my custom filters, and then I copy the rule to my custom GitHub list.
From what I've read, Vivaldi is mainly compatible with some form of AdBlock syntax. I know someone mentioned it earlier, but do we know definitively if it's more compatible with AdBlock or ABP? I just would like to know which is best to plagiarize.
-
@Danger1081 I've been using this one for reference:
https://adblockplus.org/filter-cheatsheetI think Vivaldi should support most there, except the "Extended CSS selectors" section.