Closed Alex-302 closed 4 years ago
some websites (for example Google) can use localized aria-label
, so I suggest that final syntax might be like
example.org#?#body > div:attr-contains(/ad|реклама/)
One more thing I've thought about is skipping such element attributes as 'class' and 'id'
It should be something like this:
:attr-matches(/attrnameregex/, /attrvalueregex/)
Randomized attributes are used on Yandex and Mail Ru sites. For example:
data-qh9fwcftda="Клик по баннеру,banner_240x400 - rb 1491"
<div class="lop85y260d r6lx9bmeo9 cbw5d7bijr yspzjys54h ym6trxs0lob pjohbq41cdb viewbox__slide_side_show" data-q9zbjp4jms="SpringsReload.Page" data-kvdvxkh1w2r="1491" data-qh9fwcftda="Клик по баннеру,banner_240x400 - rb 1491" data-ef828zlqmj="9">
In one case we used something like that
document.querySelectorAll("div").forEach(n => {if (Array.from(n.attributes).find(t => t.value.startsWith("Клик по баннеру"))) n.remove();});
with MutationObserver.