Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 <html>
2 <body>
4 <!-- Try to load in a frame a page which sends "X-Frame-Options: DENY", and a
5 cross-origin page which sends "X-Frame-Options: SAMEORIGIN". -->
7 <script>
9 // Make sure these iframes aren't too tall; they both need to fit inside the
10 // iframe this page is contained in, without scrolling, in order for the test's
11 // screenshots to work properly.
13 var iframe1 = document.createElement('iframe');
14 iframe1.height = '300px';
15 var iframe2 = document.createElement('iframe');
16 iframe2.height = '300px';
17 document.body.appendChild(iframe1);
18 document.body.appendChild(iframe2);
20 // This causes our embedder to take a screenshot (and blocks until the
21 // screenshot is completed).
22 alert('step 1');
24 // Wait for both iframes to load.
26 var iframe1Loaded = false;
27 iframe1.addEventListener('load', function iframe1Load() {
28 iframe1.removeEventListener('load', iframe1Load);
29 iframe1Loaded = true;
30 waitForBothLoads();
31 });
33 var iframe2Loaded = false;
34 iframe2.addEventListener('load', function iframe2Load() {
35 iframe2.removeEventListener('load', iframe2Load);
36 iframe2Loaded = true;
37 waitForBothLoads();
38 });
40 function waitForBothLoads() {
41 if (iframe1Loaded && iframe2Loaded) {
42 setTimeout(function() {
43 // This causes our embedder to take another screenshot.
44 alert('step 2');
45 }, 0);
46 }
47 }
49 iframe1.src = 'file_browserElement_XFrameOptions.sjs?DENY';
51 // Load iframe2 with the origin of our parent. Since we have a different
52 // origin and are inside <iframe mozbrowser>, this should not load.
53 iframe2.src = 'http://mochi.test:8888/tests/dom/browser-element/mochitest/file_browserElement_XFrameOptions.sjs?SAMEORIGIN';
54 </script>
56 </body>
57 </html>