Skip to content

Loading…

[Chromium] Blocked iframes not always collapsed on stackoverflow.com #673

Closed
gorhill opened this Issue · 8 comments

3 participants

@gorhill

Any question page.

From what I've gathered so far, a proper load or error event is emitted by the frame, however, the src attribute is empty -- thus the URL can't be checked against the filters.

Need to investigate further.

@gorhill gorhill changed the title from Blocked iframes not always collapsed on stackoverflow.com to [Chromium] Blocked iframes not always collapsed on stackoverflow.com
@my-password-is-password

ublockstackoverflowadzerk

adzerk.net/ados.js is responsible for the iframe ads and If you're using uBlock's default filters, EasyList has ||adzerk.net^$third-party but it also has 3 exceptions.

@@||engine.adzerk.net/ados?$script,domain=stackoverflow.com
@@||static.adzerk.net/ados.js$domain=stackoverflow.com
@@||adzerk.net/ados.js$domain=majorleaguegaming.com
@gorhill

Well whatever EasyList does, I get this:

a

Bottom-line, the content of a frame was blocked, uBlock is supposed to collapse it. It's kind of random though, probably because the blocked content collapsing code is split in two parts, the pre- and post-DOM loaded event.

I don't know why there are exceptions in EasyList for adzerk.net on StackOverflow -- but that's not the issue here. It looks to me the site works fine without that exception. Report to EasyLIst if you want, I just don't have the time.

@gorhill

Got curious as to why part of adzerk.net was whitelisted: https://hg.adblockplus.org/easylist/rev/d2083c34a335

@chrisaljoudi

@gorhill while reproducing this, it appears that the sub_frame request for the iframe is blocked indeed. However, the iframe has an explicit width and height set, and it doesn't appear that µBlock does anything to explicitly remove/hide elements for which it blocks the requests (when it makes sense to).

Which is to say: iframe, img, object, video, audio.

Am I missing something?

@gorhill

it doesn't appear that µBlock does anything to explicitly remove/hide elements for which it blocks the requests

Of course it does. The problem here is that the src property is empty, instead of being set with the URL of the blocked request.

@chrisaljoudi

@gorhill right, that's what I'd thought, but I couldn't trace it along the chain of a sub_frame request through µBlock.

I'm sorry for the inconvenience, but mind pointing me to the part that removes/hides the blocked element from the DOM?

I understand that a cosmetic filter might match the element, but it also seems like it's a good idea to manually set .style.display = "none"; for targets of certain types of requests (sub_frame, img, etc.)

@gorhill

May be related to #618.

@gorhill

Appears fixed with fix to #886. In both cases, it involved frame in a frame.

@gorhill gorhill closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.