OLD | NEW |
1 <html> | 1 <html> |
2 <iframe id="slow_frame" name="google_ads_iframe" src="/slow?100"></iframe> | 2 <iframe id="slow_frame" name="google_ads_iframe" src="/slow?100"></iframe> |
3 | 3 |
4 <script> | 4 <script> |
5 window.addEventListener('message', function(e) { | 5 window.addEventListener('message', function(e) { |
6 domAutomationController.setAutomationId(0); | |
7 window.domAutomationController.send(e.data); | 6 window.domAutomationController.send(e.data); |
8 }); | 7 }); |
9 | 8 |
10 // slow takes 100 seconds to load, plenty of time to overwrite the | 9 // slow takes 100 seconds to load, plenty of time to overwrite the |
11 // provisional load. | 10 // provisional load. |
12 let iframe = document.getElementById("slow_frame"); | 11 let iframe = document.getElementById("slow_frame"); |
13 let doc = iframe.contentDocument; | 12 let doc = iframe.contentDocument; |
14 | 13 |
15 doc.open(); | 14 doc.open(); |
16 doc.write("<html>Rewritten. <img src=pixel.png> <img src=pixel2.png> <img src=
pixel3.png onload='parent.postMessage("loaded", "*");'></htm
l>"); | 15 doc.write("<html>Rewritten. <img src=pixel.png> <img src=pixel2.png> <img src=
pixel3.png onload='parent.postMessage("loaded", "*");'></htm
l>"); |
17 doc.close(); | 16 doc.close(); |
18 </script> | 17 </script> |
19 | 18 |
20 </html> | 19 </html> |
OLD | NEW |