EHH: show number of hidden elements

Various discussions related to Adblock Plus development

EHH: show number of hidden elements

Postby famlam » Thu Jan 27, 2011 10:10 pm

Just a feature request:
it would be nice if the EHH could show the number of matches of a rule on a page.

For example, I am on a website which contains a banner has a fully random url and can only be hidden by
site.com##img[height="120"][width="130"]

To know if this filter doesn't cause any false-positives I have to check the full page if anything else does also disappear after adding that rule. [or simply assume it is correct and hope I'm not wrong]
However, it would be nice if there was a line 'This filter hides # items on this page'

I guess the most difficult part would be to exclude items inside hidden items, e.g. for ##.any not to count this two times:
<div class="any">
<div class="any thing else">
</div></div>
famlam
 
Posts: 59
Joined: Sat Aug 07, 2010 2:06 pm

Re: EHH: show number of hidden elements

Postby Wladimir Palant » Wed Feb 09, 2011 4:37 pm

Sounds like a good idea to me, over to future development.
Wladimir Palant
ABP Developer
 
Posts: 8395
Joined: Fri Jun 09, 2006 6:59 pm
Location: Cologne, Germany

Re: EHH: show number of hidden elements

Postby Crits » Sun Nov 11, 2012 12:37 pm

I created another topic dealing with the same idea, without actually having a look at this one. I'm just dumping its content here for consistency:
----------------------------------------------------------------------

1) When hovering over the ABP icon, it tells us how many times each filter is used on the page, except for the hiding rules whose numbers of hits are always: (1)

Would it be possible to actually count the real number of hits on one webpage for hiding rules?
It would be highly useful for example for list maintainers, as this features could help to quickly check if a hiding rule being tested (especially the ones with exotic CSS selectors) is causing false positives - i.e. if it matches more times than intended - without having to crawl through the source code of the page, the CSS stylesheets, etc., or having to have a really sharp eye at the webpage content.

2) In the blockable items list, could a new row containing the number of hits could be added? As it wouldn't be useful for most users, it could be hidden by default.
Author of Liste FR, an ad-blocking subscription for French websites
User avatar
Crits
 
Posts: 394
Joined: Mon Jan 16, 2012 12:54 pm
Location: France

Re: EHH: show number of hidden elements

Postby lewisje » Wed Nov 14, 2012 5:48 am

To my knowledge, the element-hiding rules are the equivalent of injecting a huge block of CSS selectors followed by {display:none!important}, so there's no real concept of "hits"
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: EHH: show number of hidden elements

Postby famlam » Thu Dec 13, 2012 12:42 am

lewisje wrote:To my knowledge, the element-hiding rules are the equivalent of injecting a huge block of CSS selectors followed by {display:none!important}, so there's no real concept of "hits"

Code: Select all
document.querySelectorAll("filter_part-after_the_##").length;

(Although this one might have to be in a try-catch since the person who adds the filter might have accidentally submitted a broken filter in which case this function throws an error)
Sorry for the lack of replies, somehow this forum loses it's "Notify me when a reply is posted" setting when it's moved to another location
famlam
 
Posts: 59
Joined: Sat Aug 07, 2010 2:06 pm

Re: EHH: show number of hidden elements

Postby Lain_13 » Fri Jan 11, 2013 8:37 am

Why not just highlight borders of blocks which are going to be hidden while editing rule? As least it could be useful as a switch in EHH dialog.
Lain_13
 
Posts: 114
Joined: Fri Dec 18, 2009 6:24 pm
Location: Wonderful World, Ubuntu Linux

Re: EHH: show number of hidden elements

Postby famlam » Fri Jan 11, 2013 9:06 am

Lain_13 wrote:Why not just highlight borders of blocks which are going to be hidden while editing rule? As least it could be useful as a switch in EHH dialog.

In that case, you'd still first have to scroll the page to see where rules match. Secondly, I'd prefer to have a preview where the page looks as it would become after applying the rule rather than elements just being highlighted (since some pages mess up only after an element is actually hidden, especially top banners with fixed position menus are good at doing that). So I don't think that would be a good idea.
famlam
 
Posts: 59
Joined: Sat Aug 07, 2010 2:06 pm

Re: EHH: show number of hidden elements

Postby Lain_13 » Sat Jan 26, 2013 7:29 pm

That's exactly why I proposed a switch between highlight and hide preview modes. In highlight mode you will see all matched elemetns and in hide mode you will see how page will looks like without them. Sometimes it's really hard to track down all changes on the page with just hide preview. Especially when you writing some crazy stuff like A:not([href*="..."]):not([href*="..."])>IMG...
Counter of actual hits would be nice to have but it wouldn't be much help.
Lain_13
 
Posts: 114
Joined: Fri Dec 18, 2009 6:24 pm
Location: Wonderful World, Ubuntu Linux


Return to Adblock Plus development

Who is online

Users browsing this forum: No registered users and 3 guests