| OLD | NEW |
| 1 if (window.testRunner) { | 1 if (window.testRunner) { |
| 2 testRunner.dumpAsText(); | 2 testRunner.dumpAsText(); |
| 3 testRunner.setXSSAuditorEnabled(true); | 3 testRunner.setXSSAuditorEnabled(true); |
| 4 testRunner.waitUntilDone(); | 4 testRunner.waitUntilDone(); |
| 5 } | 5 } |
| 6 | 6 |
| 7 function testMixedHeader(csp, xssProtection) { | 7 function testMixedHeader(csp, xssProtection) { |
| 8 var params = [ | 8 var params = [ |
| 9 'q=<script>alert(String.fromCharCode(0x58,0x53,0x53))<' + '/script>' | 9 'q=<script>alert(String.fromCharCode(0x58,0x53,0x53))<' + '/script>' |
| 10 ]; | 10 ]; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 var url = '/security/xssAuditor/resources/echo-intertag.pl?'; | 23 var url = '/security/xssAuditor/resources/echo-intertag.pl?'; |
| 24 url += params.join('&'); | 24 url += params.join('&'); |
| 25 | 25 |
| 26 document.write('<p>Testing behavior when "reflected-xss" is set to ' + csp +
', and "X-XSS-Protection" is set to ' + xssProtection + '.'); | 26 document.write('<p>Testing behavior when "reflected-xss" is set to ' + csp +
', and "X-XSS-Protection" is set to ' + xssProtection + '.'); |
| 27 document.write('<iframe src="' + url + '"></iframe>'); | 27 document.write('<iframe src="' + url + '"></iframe>'); |
| 28 } | 28 } |
| 29 | 29 |
| 30 function frameLoaded() { | 30 function frameLoaded() { |
| 31 var frame = document.querySelector('iframe'); | 31 var frame = document.querySelector('iframe'); |
| 32 try { | 32 try { |
| 33 alert('Loaded ' + frame.contentWindow.location + ' into the IFrame.'); | 33 alert('Loaded ' + frame.contentWindow.location.href + ' into the IFrame.')
; |
| 34 } catch (e) { | 34 } catch (e) { |
| 35 alert('Loaded cross-origin frame.'); | 35 alert('Loaded cross-origin frame.'); |
| 36 } | 36 } |
| 37 testRunner.notifyDone(); | 37 testRunner.notifyDone(); |
| 38 } | 38 } |
| 39 | 39 |
| 40 window.onload = frameLoaded; | 40 window.onload = frameLoaded; |
| OLD | NEW |