OLD | NEW |
1 title = Anonymous Frame document.write() - Circumvention | 1 title = Anonymous Frame document.write() - Circumvention |
2 template = testcase | 2 template = testcase |
3 | 3 |
4 <script> | 4 <script> |
5 setTimeout(function() | 5 setTimeout(function() |
6 { | 6 { |
7 var iframe = document.getElementById("append"); | 7 var iframe = document.getElementById("append"); |
8 var span = document.createElement("span"); | 8 var span = document.createElement("span"); |
9 span.className = "testcase-circ-anoniframe-docwrite"; | 9 span.className = "testcase-circ-anoniframe-docwrite"; |
10 span.textContent = "This text should be hidden"; | 10 span.textContent = "This text should be hidden"; |
11 iframe.contentDocument.body.appendChild(span); | 11 iframe.contentDocument.body.appendChild(span); |
12 var doc = document.getElementById("write").contentDocument; | 12 var doc = document.getElementById("write").contentDocument; |
13 doc.open(); | 13 doc.open(); |
14 doc.write("<span class='testcase-circ-anoniframe-docwrite'>This text should be
hidden</span>"); | 14 doc.write("<span class='testcase-circ-anoniframe-docwrite'>This text should be
hidden</span>"); |
15 doc.close(); | 15 doc.close(); |
16 }, 0); | 16 }, 0); |
17 </script> | 17 </script> |
18 | 18 |
| 19 <style> |
| 20 iframe { |
| 21 overflow: hidden; |
| 22 width: 200px; |
| 23 height: 200px; |
| 24 } |
| 25 |
| 26 .expected iframe { |
| 27 width: 98px; |
| 28 height: 98px; |
| 29 padding: 98px; |
| 30 } |
| 31 </style> |
| 32 |
19 <section class="site-panel"> | 33 <section class="site-panel"> |
20 | 34 |
21 <h2>Test case</h2> | 35 <h2>Test case</h2> |
22 <div class="testcase-container"> | 36 <div class="testcase-container"> |
23 <p> | 37 <p> |
24 Top frame: [<span class="testcase-circ-anoniframe-docwrite">This text shou
ld be hidden</span>] | 38 Top frame: [<span class="testcase-circ-anoniframe-docwrite blocked">This t
ext should be hidden</span>] |
25 </p> | 39 </p> |
26 | 40 |
27 <p> | 41 <p> |
28 Subframe (Element.appendChild): [<iframe id="append"></iframe>] | 42 Subframe (Element.appendChild): [<iframe id="append"></iframe>] |
29 </p> | 43 </p> |
30 | 44 |
31 <p> | 45 <p> |
32 Subframe (document.write): [<iframe id="write"></iframe>] | 46 Subframe (document.write): [<iframe id="write"></iframe>] |
33 </p> | 47 </p> |
34 </div> | 48 </div> |
| 49 <h3>Filters</h3> |
| 50 <pre>{{ site_url|domain }}##.testcase-circ-anoniframe-docwrite</pre> |
35 <h3>Related links</h3> | 51 <h3>Related links</h3> |
36 <p><a href="https://issues.adblockplus.org/ticket/3185">Issue #3185</a></p> | 52 <p><a href="https://issues.adblockplus.org/ticket/3185">Issue #3185</a></p> |
37 </section> | 53 </section> |
OLD | NEW |