Instead of CSS4 subject when will XPath be supported?
http://stackoverflow.com/questions/6442 ... ining-text
http://stackoverflow.com/questions/1433 ... hild-nodes
http://stackoverflow.com/questions/1183 ... -xpath-2-0
http://stackoverflow.com/questions/1604 ... with-xpath
http://stackoverflow.com/questions/1390 ... ain-string
http://stackoverflow.com/questions/1198 ... heir-value
http://stackoverflow.com/questions/1550 ... t-in-xpath
without wheel reinvention
http://css2xpath.appspot.com/
xpath adblock
- Gingerbread Man
- Posts: 1339
- Joined: Fri Aug 12, 2011 5:28 am
Re: xpath adblock
I split off this post into its own thread, because it's an interesting request if feasible, and it didn't have much to do with its parent thread.
Re: xpath adblock
We're using CSS selectors because we're directly applying them to the page without any modifications and let the browser do all the hard work for us. However, we can't do that with XPath without negatively impacting element hiding performance.
- Gingerbread Man
- Posts: 1339
- Joined: Fri Aug 12, 2011 5:28 am
Re: xpath adblock
In the same way that regexp filters are slower than regular filters butgreiner wrote:However, we can't do that with XPath without negatively impacting element hiding performance.
- Sometimes there's no other way to block the item.
- One or two slow filters won't have any noticeable impact on performance.
Re: xpath adblock
It looks like uBlock Origin has implemented both the :has() relational pseudo-class (formerly known as the parent-selector, new syntax inspired by jQuery) and XPath-based hiding rules: https://github.com/gorhill/uBlock/issue ... -230120248
It looks like this is the most relevant part of the code: https://github.com/gorhill/uBlock/blob/ ... ng.js#L748
Ideally, if :has() is ever widely implemented (right now no browsers implement it), the extension will be able to use this implementation as only a fallback.
It looks like this is the most relevant part of the code: https://github.com/gorhill/uBlock/blob/ ... ng.js#L748
Ideally, if :has() is ever widely implemented (right now no browsers implement it), the extension will be able to use this implementation as only a fallback.
There's a buzzin' in my brain I really can't explain; I think about it before they make me go to bed.
Re: xpath adblock
lewisje wrote:It looks like uBlock Origin has implemented both the :has() relational pseudo-class (formerly known as the parent-selector, new syntax inspired by jQuery) and XPath-based hiding rules: https://github.com/gorhill/uBlock/issue ... -230120248
I needed to do a filter with has() and asked to myself if ABP was having something like that...
I ask to myself if I keep ABP and use UserScripts for more complicated filters or if I switch to uBlock origin.
The only thing I would really miss is the convenience of the list of blockable items.
Debating with myself what I should do
Re: xpath adblock
uBlock Origin has a logger that is quite useful, but anyway, both :has() and xpath are being considered for ABP too: https://issues.adblockplus.org/ticket/2360
There's a buzzin' in my brain I really can't explain; I think about it before they make me go to bed.