tuyafeng / Via

Via is a simple browser, and this repository is set for localization.
3.1k stars 327 forks source link

Custom filters don't seem to be working in the new version (v4.0.4). #576

Open dajpoints opened 4 years ago

dajpoints commented 4 years ago

I've tried applying custom filters in the new version of the app to block certain elements of webpages but they don't seem to work. Am I doing something wrong? Is the new custom filter section under the Adblock settings not capable of blocking elements on a website?

The custom filters I used in the Marked Ads section of the old version(v4.0.2 or older) that worked for me: duckduckgo.com .ddgsi, .tag-home__item, #wedonttrack

How would I block those elements in the new version? I've tried various possibilities using the example given in the help section but none seem to work.

Also when I mark an ad in the newest version it only works once to block it, when I refresh the site it doesn't apply again. Why?

tuyafeng commented 4 years ago

The function of marking as ad is not very stable, because some elements of webpages are generated by scripts, and they usually have random ids.

You can try the following filter to remove duckduckgo.com elements:

duckduckgo.com##.ddgsi,.tag-home__item,#wedonttrack

By the way, the performance of ad blocking is also related to the number of filters. When more than a certain number of filters are loaded, subsequent filters will not be loaded. So I recommend you not to subscribe to more than three sources.

dajpoints commented 4 years ago

You can try the following filter to remove duckduckgo.com elements:

duckduckgo.com##.ddgsi,.tag-home__item,#wedonttrack

Tried it but it's not doing anything to block those elements. For some reason it isn't applying correctly to the site as it should. I've tried blocking certain elements on other sites as well and the results are all the same. Is it working for you?

tuyafeng commented 4 years ago

It is normal for me to test the custom filter here.

There are several reasons for the function failure:

  1. Ad blocking is disabled
  2. JavaScript is disabled (this feature is based on JavaScript)
  3. Too many subscription filters (please try it after disabling all subscription filters list)
  4. Resource policy restriction of the website (but in general, this is not possible, because the current element filtering is achieved by forging a css file of the same origin)
  5. Other undiscovered problems
t0n4 commented 4 years ago

Disabled all Filters Subscription Screenshot_20200730-045209

and enter this in Custom Filters

Screenshot_20200730-045155

duckduckgo.com##DIV.onboarding-ed.js-onboarding-ed

duckduckgo.com##DIV.tag-home__item,DIV.js-atb-banner-link.btn.btn--primary.atb-banner__btn.atb-banner__btn--install,DIV.js-atb-banner-learnmore.btn.btn--primary.atb-banner__learn-more

If you enabled the filter subscription EasyList the Custom Filters won't work.

Enabled 1 by 1 Filter Subscription, when you enabled one Filter Subscription restart Via Browser if the custom filter won't work is because the filter subscription is not compatible with the custom filters

No Custom Filter Screenshot_20200730-045020

Custom Filter Screenshot_20200730-045243

dajpoints commented 4 years ago

Thanks, I had EasyList enabled. After disabling it, the custom filters work now.
Is there no way to get the custom filters to work while EasyList is enabled? I use the Ublock Origin extension in Firefox/Chrome on my laptop and it uses EasyList and can still block custom filters. I'll try looking for another filter list that can still block many ads (especially youtube ads) and is compatible with the custom filters. Thanks for the help!

t0n4 commented 4 years ago

Thanks, I had EasyList enabled. After disabling it, the custom filters work now. Is there no way to get the custom filters to work while EasyList is enabled? I use the Ublock Origin extension in Firefox/Chrome on my laptop and it uses EasyList and can still block custom filters. I'll try looking for another filter list that can still block many ads (especially youtube ads) and is compatible with the custom filters. Thanks for the help!

Here are the Filter Subscription that I use, I added EasyList (Minified) and appear the Custom Filters work

https://easylist-downloads.adblockplus.org/easylist-minified.txt

The filter Adblock Warning Removal won't work but I have it enabled lol

Screenshot_20200730-144050

Screenshot_20200730-144059

Screenshot_20200730-144114

Screenshot_20200730-144124

Screenshot_20200730-144132

brokoler commented 4 years ago

Hello,

I also was not able to get custom filters to work with version 4.0.8 of Via. I tried adding following blocklists to remove cookie notifications: https://www.i-dont-care-about-cookies.eu/abp/ https://easylist-downloads.adblockplus.org/easylist-cookie.txt

They get loaded in settings but don't block anything (for example: amazon.com, weather.com, ebay.com). Cookie notifications which get blocked by these lists are not working.

Would be great if this could be fixed.

tuyafeng commented 4 years ago

Okay, I will test it, thank you for the information.