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

General discussion about web technology.
User avatar
Thrawn
Senior Member
Posts: 3106
Joined: Mon Jan 16, 2012 3:46 am
Location: Australia
Contact:

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

Post by Thrawn » Tue Nov 17, 2015 12:21 am

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).
======
Thrawn
------------
Religion is not the opium of the masses. Daily life is the opium of the masses.

True religion, which dares to acknowledge death and challenge the way we live, is an attempt to wake up.
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:42.0) Gecko/20100101 Firefox/42.0

barbaz
Senior Member
Posts: 9139
Joined: Sat Aug 03, 2013 5:45 pm

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

Post by barbaz » Tue Nov 17, 2015 2:19 am

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).
*Always* check the changelogs BEFORE updating that important software!
-

gorhill
Junior Member
Posts: 40
Joined: Sun Mar 30, 2014 12:19 pm

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

Post by gorhill » Wed Nov 18, 2015 4:25 pm

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.
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:42.0) Gecko/20100101 Firefox/42.0

barbaz
Senior Member
Posts: 9139
Joined: Sat Aug 03, 2013 5:45 pm

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

Post by barbaz » Wed Nov 18, 2015 7:12 pm

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.
*Always* check the changelogs BEFORE updating that important software!
-

User avatar
Thrawn
Senior Member
Posts: 3106
Joined: Mon Jan 16, 2012 3:46 am
Location: Australia
Contact:

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

Post by Thrawn » Wed Nov 18, 2015 10:36 pm

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).
======
Thrawn
------------
Religion is not the opium of the masses. Daily life is the opium of the masses.

True religion, which dares to acknowledge death and challenge the way we live, is an attempt to wake up.
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:42.0) Gecko/20100101 Firefox/42.0

barbaz
Senior Member
Posts: 9139
Joined: Sat Aug 03, 2013 5:45 pm

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

Post by barbaz » Wed Nov 18, 2015 10:54 pm

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!
*Always* check the changelogs BEFORE updating that important software!
-

Post Reply