dom/browser-element/mochitest/file_browserElement_XFrameOptionsAllowFrom.html

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

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 cross-origin page which sends:
     5      "X-Frame-Options: Allow-From http://mochi.test:8888/",
     6        and a cross-origin page which sends
     7      "X-Frame-Options: Allow-From http://example.com/". -->
     9 <script>
    11 // Make sure these iframes aren't too tall; they both need to fit inside the
    12 // iframe this page is contained in, without scrolling, in order for the test's
    13 // screenshots to work properly.
    15 var frame_src = 'http://example.com/tests/dom/browser-element/mochitest/file_browserElement_XFrameOptionsAllowFrom.sjs';
    17 var iframe1 = document.createElement('iframe');
    18 iframe1.height = '300px';
    19 var iframe2 = document.createElement('iframe');
    20 iframe2.height = '300px';
    21 document.body.appendChild(iframe1);
    22 document.body.appendChild(iframe2);
    24 iframe1.addEventListener('load', function iframe1Load() {
    25   iframe1.removeEventListener('load', iframe1Load);
    26   // This causes our embedder to take a screenshot (and blocks until the
    27   // screenshot is completed).
    28   var iframe2Loaded = false;
    29   iframe2.addEventListener('load', function iframe2Load() {
    30     iframe2.removeEventListener('load', iframe2Load);
    31     iframe2Loaded = true;
    32     alert('finish');
    33   });
    35   setTimeout(function() { iframe2.src = frame_src; }, 1000);
    36 });
    39 iframe1.src = frame_src + '?iframe1';
    40 </script>
    42 </body>
    43 </html>

mercurial