tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

reconnectToPresentation_sandboxing_success.https.html (1262B)


      1 <!DOCTYPE html>
      2 <meta charset="utf-8">
      3 <title>Sandboxing: Reconnecting a presentation from a nested context succeeds when allow-presentation is set</title>
      4 <link rel="author" title="Francois Daoust" href="https://www.w3.org/People/#fd">
      5 <link rel="help" href="http://w3c.github.io/presentation-api/#dom-presentationrequest-reconnect">
      6 <script src="/resources/testharness.js"></script>
      7 <script src="/resources/testharnessreport.js"></script>
      8 <script>
      9    async_test(function (t) {
     10        function startWhenReady(ev) {
     11            var childFrame = document.getElementById('childFrame');
     12            if (ev.data === 'ready') {
     13                window.removeEventListener('message', startWhenReady);
     14                childFrame.contentWindow.postMessage('reconnect', '*');
     15                window.addEventListener('message', t.step_func(function (ev) {
     16                    assert_equals(ev.data, 'NotFoundError',
     17                        'Presentation sandboxing did not work as expected.');
     18                    t.done();
     19                }));
     20            }
     21        }
     22        window.addEventListener('message', startWhenReady);
     23    });
     24 </script>
     25 <iframe id="childFrame" sandbox="allow-scripts allow-presentation" style="display:none" src="support/iframe.html"></iframe>