Opened on 04/19/2018 at 11:16:55 AM
Closed on 08/29/2019 at 05:43:18 PM
#6598 closed defect (rejected)
Element hiding filters covering iframes with display: block !important style hide too much
Reported by: | arthur | Assignee: | |
---|---|---|---|
Priority: | Unknown | Milestone: | |
Module: | Platform | Keywords: | closed-in-favor-of-gitlab |
Cc: | amrmak, mjethani, sebastian, kzar, mapx | Blocked By: | |
Blocking: | Platform: | Unknown / Cross platform | |
Ready: | no | Confidential: | no |
Tester: | Unknown | Verified working: | no |
Review URL(s): |
Description (last modified by mjethani)
Environment
Chrome 66.0.3359.117 (Official Build) (64-bit)
ABP 3.0.3.2011
EasyList enabled
How to reproduce
- Add these two custom filters to ABP
coed.com##iframe[style="display: block !important; height: 310px !important; width: 100% !important; visibility: visible !important; border: 0px !important;"]
pocketnow.com##iframe[style="display: block !important; height: 600px !important; width: 100% !important; visibility: visible !important; border: 0px !important;"]
- Go to this page and this page.
Observed behaviour
Sometimes the page looks very broken or completely blank.
Expected behaviour
The pages should show properly, the top ad on coed.com should be hidden, the ad at the bottom on pocketnow.com should be hidden.
Notes
This doesn't seem to happen in every case where these circiumvention ads (Uponit) are used. It works fine on phonesreview.co.uk removed by phonesreview.co.uk##iframe[style*="display: block !important;"] in EasyList.
The issue looks very similar to #6298, though reducing the selector group size to 256 or even 16 in lib/cssInjection.js doesn't seem to improve the situation.
Attachments (0)
Change History (16)
comment:1 Changed on 04/19/2018 at 11:18:35 AM by amrmak
- Cc amrmak added
comment:2 Changed on 04/19/2018 at 11:34:13 AM by mjethani
- Cc mjethani sebastian kzar added
comment:4 Changed on 04/19/2018 at 04:23:08 PM by mapx
- Cc mapx added
comment:5 Changed on 04/19/2018 at 04:31:17 PM by mapx
comment:6 Changed on 04/19/2018 at 04:48:27 PM by mjethani
@mapx do you mean that adding this script:inject filter fixes the issue on uBO?
comment:7 Changed on 04/19/2018 at 05:00:45 PM by mapx
Sure.
comment:8 Changed on 04/19/2018 at 05:01:30 PM by mapx
Well, I mean add that inject filter but without the hiding filter above.
comment:9 Changed on 04/19/2018 at 05:04:12 PM by mapx
However, you can even add the hiding filter, no effect anymore (probably because the trick is wiped out by the injecting filter)
comment:10 Changed on 04/19/2018 at 05:06:32 PM by mjethani
@mapx thanks, that really helps.
comment:11 Changed on 04/19/2018 at 05:33:57 PM by mapx
Other observation:
in uBo is working as well (I mean stopping the ads):
coed.com##script:inject(nowebrtc.js)
but in ABP $webrtc does not work: ||coed.com^$webrtc
chrome://webrtc-internals/ => still showing all the opened webrtc channels
comment:12 Changed on 04/19/2018 at 06:33:37 PM by mapx
working filter (courtesy of gorhill)
coed.com#?#div[id]:-abp-has(> iframe[id]:not([src]))
comment:13 Changed on 04/19/2018 at 06:50:04 PM by mapx
Using Arthur's filter above and adding minimum width, height (via :style in uBo which can add / modify styles) is working fine in uBo (so probably - as gorhill is supposing - the scripting code downloaded via webrtc is testing if the iframe used for ads has a width or height of 0)
coed.com##iframe[style="display: block !important; height: 310px !important; width: 100% !important; visibility: visible !important; border: 0px !important;"]:style(width: 1px !important; height: 1px !important;)
However this does not explain why this 1 is working:
coed.com#?#div[id]:-abp-has(> iframe[id]:not([src]))
comment:14 follow-up: ↓ 15 Changed on 04/19/2018 at 09:18:12 PM by mjethani
It seems it has nothing to do with the filters in question. I'm not fully sure about this, but it seems that once the page finds out that some ads are blocked it tries to rewrite the content, but because some of the scripts are blocked too it doesn't succeed in rewriting new content. The final HTML contains no content, only a (empty) header and a (empty) footer.
I have seen this behavior even when these filters don't match but some old (generic?) filters in EasyList match.
comment:15 in reply to: ↑ 14 Changed on 04/20/2018 at 11:30:28 AM by mjethani
Replying to mjethani:
I'm not fully sure about this, but it seems that once the page finds out that some ads are blocked it tries to rewrite the content, but because some of the scripts are blocked too [emphasis added] it doesn't succeed in rewriting new content.
So this problem should not occur if EasyList is not enabled and these are the only filters, it would be nice if someone could confirm.
comment:16 Changed on 08/29/2019 at 05:43:18 PM by sebastian
- Keywords closed-in-favor-of-gitlab added
- Resolution set to rejected
- Status changed from new to closed
Sorry, but we switched to GitLab. If this issue is still relevant, please file it again in the new issue tracker.
In uBo the page is broken too. Could be intentional ?!
However, in uBo it's the alternative (injecting filters)
https://github.com/uBlockOrigin/uAssets/commit/e1471849ac43181b4aa1328a79a8904b40303ba6