
Loading…
Blocking parent element #1458
I'm not a pro, but perhaps adding :
www.videostream.biz/wp-content/uploads/an-temp/*$script
... to "My Filters" might get the job done.
See if that doesn't break other expected functionality.
Once your browser supports the :has() relational pseudo-selector in CSS Selectors Level 4, currently in draft form, you can write a hiding rule like videostream.biz##div:has(> h1) (similar to jQuery's implementation of this selector); at the moment, however, there is no way in CSS to select an element based on its descendant elements, and even in Selectors Level 4, there is no way to select an element by its text content.
Maybe uBlock could enhance its hiding-selector syntax by developing a custom selector engine (possibly translating any rule with :has() in it into an XPath selector), but it would then need to have a hiding strategy other than just injecting a bunch of style rules.
Wow. That's great news that several new relational pseudo classes are still slated for CSS4. Do you know when the draft is supposed to be finalized, or if any browsers will implement them before the draft is finalized?
You also mentioned XPath selectors... does uBlock (or ABE/ABP for that matter) support XPath selectors in any way?
What I was talking about was possibly translating certain rules from future specifications into XPath, not supporting XPath itself in hiding rules, but the performance issues would likely be similar to supporting XPath directly in rules, which an ABP developer cited for why ABP doesn't support them: https://adblockplus.org/forum/viewtopic.php?t=21209
Is there a way to block a parent element? For example on http://www.videostream.biz , the overlay is in this format:
The
<div>idas well asclassare dynamically generated, statically blocking is not a solution. How can I write a selector for<h1>Adblocker detected!and selecting the parent<div>?Even something like
videostream.biz##h1 < divwill be sufficient.