Strip out Referer header when requesting subresources or following links for document...
[WebKit-https.git] / LayoutTests / http / tests / contentdispositionattachmentsandbox / subresource-request-not-include-referer-header.html
1 <!DOCTYPE html>
2 <script>
3 if (window.internals)
4     internals.settings.setContentDispositionAttachmentSandboxEnabled(true);
5
6 if (window.testRunner) {
7     testRunner.dumpAsText();
8     testRunner.dumpChildFramesAsText();
9     testRunner.waitUntilDone();
10 }
11
12 function navigation() {
13     // Due to the sandbox, it's not possible to run script in the iframe or even access its contentDocument.
14     var element = document.getElementById('iframe');
15     var x = element.offsetLeft + 10;
16     var y = element.offsetTop + 10;
17
18     if (window.testRunner) {
19         if (window.eventSender) {
20             eventSender.mouseMoveTo(x, y);
21             eventSender.mouseDown();
22             eventSender.mouseUp();
23         }
24
25         if (testRunner.runUIScript)
26             testRunner.runUIScript("(function() { uiController.singleTapAtPoint(" + x + ", " + y + "); })()");
27     }
28 }
29 </script>
30 <p>This test verifies that a subresource loaded by a document which is loaded with Content-Disposition:attachment will not have http referer. Tess passes if no referer is printed.</p>
31 <iframe id='iframe' src="resources/subresource-request-not-include-referer-header-frame.php" onload="navigation()"></iframe>