Page 2 of 2

Re: XHR/JS...Objects.. NoScript and uBo. Help me understand

Posted: Tue Nov 17, 2015 12:21 am
by Thrawn
OK, I guess I misspoke there; ABP has element hiding, but it also has blocking. However, as I understand it, that blocking is not entirely reliable in recent versions.

(And the author of uBlock indicated that the hiding rules involve injection of a huge stylesheet into every page, which is one reason uBlock can be faster and lighter: it's more selective).

Re: XHR/JS...Objects.. NoScript and uBo. Help me understand

Posted: Tue Nov 17, 2015 2:19 am
by barbaz
Thrawn wrote:ABP has element hiding, but it also has blocking. However, as I understand it, that blocking is not entirely reliable in recent versions.
Yes, this is correct.
Thrawn wrote:(And the author of uBlock indicated that the hiding rules involve injection of a huge stylesheet into every page,
That is only because of a Gecko bug that has been fixed in 41 (or was it 42? I kinda skipped a few versions)
Thrawn wrote:uBlock can be faster and lighter: it's more selective).
But reportedly as a side effect of its design its element hiding does not apply to pages right away causing elements to be hidden first briefly "flash" on the screen... ABP's element hiding method, if applied in real time, can actually prevent sub-nodes from loading resources (but that is also a side-effect).

Re: XHR/JS...Objects.. NoScript and uBo. Help me understand

Posted: Wed Nov 18, 2015 4:25 pm
by gorhill
barbaz wrote:That is only because of a Gecko bug that has been fixed in 41 (or was it 42? I kinda skipped a few versions)
Fixed in FF 41. The fix certainly helped the Firefox version of ABP a lot. But even then, this is not enough to bring ABP on par with uBO: see Firefox version: benchmarking memory footprint. And for ABP the issue still persist for non-Firefox browsers.
barbaz wrote:But reportedly as a side effect of its design its element hiding does not apply to pages right away causing elements to be hidden first briefly "flash" on the screen... ABP's element hiding method, if applied in real time, can actually prevent sub-nodes from loading resources (but that is also a side-effect).
This may happen only for generic cosmetic filters, not specific ones, and only the first time site-wide for when a page is pulled from it (because generics are per-site cached). Roughly there are ~20,000 specific and ~14,000 generic cosmetic filters in EasyList. I provide insights here about the differences of uBO with ABP regarding cosmetic filtering (element hiding): Does uBlock block ads or just hide them?

In practice, it has been quite a long time anybody complained of this happening, and when it has been reported in the past, after I explain the why, users seem to find that this is an acceptable potential quirk given what is gained in return. And this is a quirk which can be easily worked around by creating a specific cosmetic filter using the element picker (specific cosmetic filters are injected early enough when a page load). The issue is more likely to arise on slower computers, but then ABP can be really a pain to use on slower computers.

In the big picture, where all aspects of the blockers are considered, this is a non-issue -- and the claim that uBO blocks less efficiently than ABP is really without basis at this point. I can also find many cases where ABP does not do too well compared to uBO, for example try "buy car" for Yahoo Search.

Re: XHR/JS...Objects.. NoScript and uBo. Help me understand

Posted: Wed Nov 18, 2015 7:12 pm
by barbaz
gorhill wrote:And for ABP the issue still persist for non-Firefox browsers.
I don't think I understand this statement. The related bugs are https://bugzilla.mozilla.org/show_bug.cgi?id=77999 and https://bugzilla.mozilla.org/show_bug.cgi?id=988266, and none of the patches/commits contain any Firefox-specific code - it's all in Gecko.
Can you please clarify?
gorhill wrote:This may happen only for generic cosmetic filters, not specific ones, and only the first time site-wide for when a page is pulled from it (because generics are per-site cached). Roughly there are ~20,000 specific and ~14,000 generic cosmetic filters in EasyList. I provide insights here about the differences of uBO with ABP regarding cosmetic filtering (element hiding): Does uBlock block ads or just hide them?

In practice, it has been quite a long time anybody complained of this happening, and when it has been reported in the past, after I explain the why, users seem to find that this is an acceptable potential quirk given what is gained in return. And this is a quirk which can be easily worked around by creating a specific cosmetic filter using the element picker (specific cosmetic filters are injected early enough when a page load). The issue is more likely to arise on slower computers, but then ABP can be really a pain to use on slower computers.
Ah, OK. Thanks for posting the explanation, links, & workaround.

Re: XHR/JS...Objects.. NoScript and uBo. Help me understand

Posted: Wed Nov 18, 2015 10:36 pm
by Thrawn
barbaz wrote: ...none of the patches/commits contain any Firefox-specific code - it's all in Gecko.
Can you please clarify?
I'm guessing he referred to the fact that both ABP and uBlock support Chrome(ium).

Re: XHR/JS...Objects.. NoScript and uBo. Help me understand

Posted: Wed Nov 18, 2015 10:54 pm
by barbaz
Oh jeez. Yeah, IIRC ABP for Blink-based browsers injects a huge stylesheet directly into each page (using something called "shadow DOM" was it? don't remember). gorhill's design for ublock, despite it probing the DOM in some cases, is undeniably one hell of a lot more memory efficient & CPU efficient than that!