xpath adblock

Various discussions related to Adblock Plus development

Re: xpath adblock

Postby Gingerbread Man » Wed Feb 12, 2014 9:03 am

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.
User avatar
Gingerbread Man
 
Posts: 1339
Joined: Fri Aug 12, 2011 5:28 am

Re: xpath adblock

Postby greiner » Fri May 02, 2014 4:13 pm

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.
User avatar
greiner
ABP Developer
 
Posts: 669
Joined: Mon Sep 03, 2012 5:29 pm
Location: Cologne, Germany

Re: xpath adblock

Postby Gingerbread Man » Sat May 03, 2014 9:32 am

greiner wrote:However, we can't do that with XPath without negatively impacting element hiding performance.

In the same way that regexp filters are slower than regular filters but
  1. Sometimes there's no other way to block the item.
  2. One or two slow filters won't have any noticeable impact on performance.
User avatar
Gingerbread Man
 
Posts: 1339
Joined: Fri Aug 12, 2011 5:28 am

Re: xpath adblock

Postby lewisje » Tue Jul 05, 2016 6:56 pm

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.
There's a buzzin' in my brain I really can't explain; I think about it before they make me go to bed.
lewisje
 
Posts: 2743
Joined: Mon Jun 14, 2010 12:07 pm

Re: xpath adblock

Postby mikhoul » Sun Aug 21, 2016 5:30 am

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 :roll:
mikhoul
 
Posts: 17
Joined: Thu Jan 24, 2013 6:54 pm

Re: xpath adblock

Postby lewisje » Sun Aug 21, 2016 6:53 am

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.
lewisje
 
Posts: 2743
Joined: Mon Jun 14, 2010 12:07 pm

Re: xpath adblock

Postby mapx » Sun Aug 21, 2016 8:11 am

User avatar
mapx
 
Posts: 21726
Joined: Thu Jan 06, 2011 3:01 pm


Return to Adblock Plus development

Who is online

Users browsing this forum: No registered users and 2 guests