CoreLibs
CoreLibs copied to clipboard
tv.rambler.ru - element hiding rules `##`, `#$#` do not apply to the site
The problem is element hiding rules ##, #$# like the example below are not applied to the site.
tv.rambler.ru##body
To reproduce it:
- turn all filters off
- add the rule above to the user rules
- open the site
tv.rambler.ruin any browser. You will see that the page is not hidden.
Screenshot:
Expected behaviour - element hiding rules must be applied.
Regarding tv.rambler.ru, as far as I understand, the problem is that whole content is removed and then re-added (currently there is b.removeChild(b.documentElement) in https://tv.rambler.ru/static/js/desktop.vendors.9ea7661d.js) and it causes that style tag added by AdGuard is removed.
Another example.
The same problem occurs if website remove and then re-add head tag.
Steps to reproduce:
- Add this rule:
example.org##body
- Go to - https://example.org/
- Open browser console and run:
(() => {
const head = document.head;
const cloneHead = head.cloneNode(true);
cloneHead.querySelectorAll('style[nonce][type="text/css"]').forEach(e => e.remove());
document.documentElement.insertAdjacentElement('afterbegin', cloneHead);
setTimeout(() => {
head.remove();
}, 500);
})();
Expected behavior
Content is hidden by example.org##body
Actual behavior Style tag added by AdGuard is removed.