Skip to content

Instantly share code, notes, and snippets.

@ThomasGreiner
Last active October 9, 2015 15:39
Show Gist options
  • Save ThomasGreiner/43baf081642d4b906d2a to your computer and use it in GitHub Desktop.
Save ThomasGreiner/43baf081642d4b906d2a to your computer and use it in GitHub Desktop.
Adblock Plus issues #3185 and #3186
<!DOCTYPE html>
<html>
<head>
<title>Element Hiding: Anonymous iFrame</title>
</head>
<body>
<p>
Top frame: [<span class="hide">This text should be hidden</span>]
</p>
<p>
Subframe (Element.appendChild): [<iframe id="append"></iframe>]
</p>
<p>
Subframe (document.write): [<iframe id="write"></iframe>]
</p>
<script>
setTimeout(function()
{
var iframe = document.getElementById("append");
var span = document.createElement("span");
span.className = "hide";
span.textContent = "This text should be hidden";
iframe.contentDocument.body.appendChild(span);
var doc = document.getElementById("write").contentDocument;
doc.open();
doc.write("<span class='hide'>This text should be hidden</span>");
doc.close();
}, 0);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment