Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <?php | 1 <?php |
| 2 // Prevent from being cached. | 2 // Prevent from being cached. |
| 3 header("Cache-Control: no-store, private, max-age=0"); | 3 header("Cache-Control: no-store, private, max-age=0"); |
| 4 header("Content-Type: text/html"); | 4 header("Content-Type: text/html"); |
| 5 ?> | 5 ?> |
| 6 | 6 |
| 7 <html><body> | 7 <html><body> |
| 8 <div id="console"></div> | 8 <div id="console"></div> |
| 9 <div id="referrer"> | 9 <div id="referrer"> |
| 10 Referrer: <?php echo $_SERVER['HTTP_REFERER']; ?> | 10 Referrer: <?php echo $_SERVER['HTTP_REFERER']; ?> |
| 11 </div> | 11 </div> |
| 12 <br/> | 12 <br/> |
| 13 <script> | 13 <script> |
| 14 function log(msg) | 14 function log(msg) |
| 15 { | 15 { |
| 16 var line = document.createElement('div'); | 16 var line = document.createElement('div'); |
| 17 line.appendChild(document.createTextNode(msg)); | 17 line.appendChild(document.createTextNode(msg)); |
| 18 document.getElementById('console').appendChild(line); | 18 document.getElementById('console').appendChild(line); |
| 19 } | 19 } |
| 20 | 20 |
| 21 var consoleWindow = window.open("", "consoleWindow"); | 21 var consoleWindow = window.open("", "consoleWindow"); |
| 22 if (consoleWindow) { | 22 if (consoleWindow && consoleWindow.log) { |
|
Łukasz Anforowicz
2016/06/06 21:17:14
The new condition is necessary to check if console
| |
| 23 consoleWindow.log(document.getElementById("referrer").innerText); | 23 consoleWindow.log(document.getElementById("referrer").innerText); |
| 24 consoleWindow.log("window.opener: " + (window.opener ? window.opener.loc ation : "")); | 24 consoleWindow.log("window.opener: " + (window.opener ? window.opener.loc ation : "")); |
| 25 } | 25 } |
| 26 | 26 |
| 27 if (window.testRunner) | 27 if (window.testRunner) |
| 28 testRunner.notifyDone(); | 28 testRunner.notifyDone(); |
| 29 </script> | 29 </script> |
| 30 | 30 |
| 31 </body></html> | 31 </body></html> |
| OLD | NEW |