AdguardTeam / AdguardTeam/tsurlfilter

Prevent Adguard from hiding html or body when matched by a generic cosmetic filter

Aberta
#32 3 comentários 1 reação 0 responsáveis Ver no GitHub
enhancement
Linguagem predominante
TypeScript
Estrelas
81
Forks
20
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

- [x] I am running the latest version
- [x] I checked the documentation and found no answer
- [x] I checked to make sure that this issue has not already been filed

### Problem Description / ### Proposed Solution

There have been numerous occasions where Annoyance lists have blanked out websites because either `html` or `body` have contained values that have been matched by a generic cosmetic filter. This is a pretty common issue for Annoyance lists, though there have been a few occasions in normal adblocking as well.

Usually these issues have been fixed by adding `:not(html)` or `:not(body)` exception to the problematic generic cosmetic filter.

I was wondering if it would be reasonable to add a safeguard measure to Adguard: to prevent it from applying cosmetic filters, that have a match in `html` or `body` in websites where an user is visiting. I think that neither `html` or `body` should ever be blocked as that will result in a blank website.

One recent sample issue from Fanboy's Annoyance: https://github.com/easylist/easylist/pull/8431 - `https://webshop.elektroskandia.no/` was blanked out because `body` in that website had a value of `.consent-summary-shown`. It was matched by this generic GDPR filter: `##.consent-summary-shown`. (It was later fixed by adding an exception: `##.consent-summary-shown:not(body)`).

But that wasn't the only case. In Fanboy's Annoyance list, there are currently:

260 `:not(html)` exceptions
298 `:not(body)` exceptions

Adguard Annoyance:

127 `:not(html)` exceptions
160 `:not(body)` exceptions

Easylist:

4 `:not(html)` exceptions
7 `:not(body)` exceptions

I know these website blanking issues are mainly related to Annoyance lists that are not turned on by default in Adguard, but they are still available and people use them. Not all issues get reported to filter list maintainers and there could be many unreported issues relating to these lists. Each `:not(html)` or `:not(body)` exception that currently exists, are related to fixing blank websites.

A sample page to test this issue with:

https://webshop.elektroskandia.no/ (fixed now in Fanboy's Annoyance but this one is a recent case so I'll use it as a sample)

1. Disable any possible Annoyance lists (to get rid of later added whitelistings)
2. Add filter `##.consent-summary-shown`
3. Go to https://webshop.elektroskandia.no/
4. Website will be blanked because there's a match in body element:

![kuva](https://user-images.githubusercontent.com/17256841/130367027-9e1e6b18-4194-43a8-a310-9880a642b4ee.png)

### Alternatives Considered

Such don't really exist, unless each generic filter would be pre-supplied with `:not(html):not(body)` exception pre-emptively.

### Additional Information

-

Guia de contribuição

Nenhum guia de contribuição indexado para este repositório

Direção de pesquisa

Start by reproducing the reported filter `##.consent-summary-shown` on webshop.elektroskandia.no with annoyance lists disabled, then trace the cosmetic-filtering entry point that handles matches on `html` and `body`. Done means generic cosmetic filters no longer hide either element while ordinary matching behavior remains intact, with coverage for the sample case.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
typescript
Domínio
web-dev
Tipo de issue
Funcionalidade
Dificuldade
5/5
Tempo estimado
Mais de uma semana
Status de atividade
Estagnada
Clareza
Razoavelmente clara
Facilidade para iniciantes
32/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.