Opened on 10/09/2015 at 03:37:23 PM
Closed on 08/29/2019 at 12:31:50 PM
Last modified on 08/29/2019 at 12:34:45 PM
#3185 closed defect (worksforme)
Element hiding unapplied when anonymous iFrame content added via document.write
Reported by: | greiner | Assignee: | mjethani |
---|---|---|---|
Priority: | P3 | Milestone: | |
Module: | Platform | Keywords: | circumvention |
Cc: | arthur, sebastian, amrmak, Anton, agiammarchi, Ross, mario | Blocked By: | |
Blocking: | Platform: | Unknown / Cross platform | |
Ready: | no | Confidential: | no |
Tester: | Unknown | Verified working: | no |
Review URL(s): |
Description (last modified by sebastian)
Environment
Chrome 45
Adblock Plus 1.9.3
How to reproduce
- Add ##.hide filter to Adblock Plus.
- Clone gist.
- Set up local static server for the file and navigate to it in the browser.
Observed behavior
"This text should be hidden" shows up next to "Subframe (document.write)".
Expected behavior
"This text should be hidden" doesn't show up anywhere on the page.
Attachments (0)
Change History (18)
comment:1 Changed on 10/19/2015 at 06:58:24 AM by sebastian
- Priority changed from Unknown to P2
- Ready set
comment:2 Changed on 10/19/2015 at 07:03:52 AM by sebastian
- Cc sebastian added
I'm afraid I wouldn't be able to look any deeper into this issue anytime soon. @greiner: Would you mind?
comment:4 Changed on 01/15/2016 at 03:42:35 PM by sebastian
- Description modified (diff)
Please create a separate issue for Maxthon. There effected code here isn't shared between Chrome and Maxthon.
comment:5 Changed on 01/15/2016 at 04:48:53 PM by sebastian
- Priority changed from P2 to P3
- Ready unset
- Sensitive set
I figured out that content scripts don't run again after document.write() has been called, replacing the DOM and therefore also removing our stylesheet. I'm not even sure if this is a bug, as it's not really a new document but merely replacing it's entire content, which could be achieved as well with the DOM API.
However, stylesheets injected with chrome.tabs.insertCSS persist. Also, due to other issues we had and still have with injecting a stylesheet into the DOM using a content script (with and without Shadow DOM), I'm in the favor to use chrome.tabs.insertCSS as soon as frame IDs are supported.
But with our current approach, there seems to be no great workarounds. The nodes that are removed/overridden by document.write() aren't reported by a MutationObserver. Theoretically, we could still poll (once a second or so) whether our stylesheet is still in there. But that would obviously impair performance, and the content to be blocked would still show up for a notable amount of time.
I'm making this issue confidential as it provides a way to circumvent Adblock Plus.
comment:6 Changed on 01/18/2016 at 08:51:16 AM by scheer
New issue created for Maxthon and also marked as confidential. https://issues.adblockplus.org/ticket/3526#comment:1
comment:7 Changed on 03/02/2018 at 10:45:10 AM by mjethani
- Keywords circumvention added
comment:8 Changed on 03/08/2018 at 09:19:39 PM by amrmak
- Cc amrmak added
comment:9 Changed on 04/16/2018 at 01:56:14 PM by mjethani
This is no longer an issue with user style sheets.
comment:10 Changed on 04/16/2018 at 02:28:45 PM by sebastian
Well, there are element hiding emulation filters (and potentially other anti-circumvention measures implemented in content scripts in the future) that would still be effected.
comment:11 Changed on 11/21/2018 at 08:44:48 AM by mjethani
- Owner set to mjethani
comment:12 Changed on 11/21/2018 at 08:50:23 AM by mjethani
comment:13 Changed on 11/21/2018 at 08:51:17 AM by mjethani
- Cc Anton added
comment:14 Changed on 11/21/2018 at 08:55:00 AM by mjethani
Also let's remove the confidential flag.
comment:15 Changed on 11/21/2018 at 10:13:19 AM by mjethani
- Cc agiammarchi Ross added
comment:16 Changed on 08/29/2019 at 12:01:06 PM by arthur
- Cc mario added
comment:17 Changed on 08/29/2019 at 12:31:50 PM by sebastian
- Resolution set to worksforme
- Status changed from new to closed
Closing this issue as per comment:12. If still relevant, please file a new issue on GitLab.
comment:18 Changed on 08/29/2019 at 12:34:45 PM by arthur
- Sensitive unset
Reproduced and identief as regression caused by a400e15525fc.