tor-browser

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

document-exit-fullscreen-active-document.html (854B)


      1 <!DOCTYPE html>
      2 <title>
      3    Document#exitFullscreen() when the document is not the active document
      4 </title>
      5 <script src="/resources/testharness.js"></script>
      6 <script src="/resources/testharnessreport.js"></script>
      7 <div id="log"></div>
      8 <iframe allowfullscreen></iframe>
      9 <script>
     10    promise_test(async (t) => {
     11        const iframe = document.querySelector("iframe");
     12        const stolenTypeError = iframe.contentWindow.TypeError;
     13        const documentBeforeNav = iframe.contentDocument;
     14 
     15        await new Promise((resolve) => {
     16            iframe.onload = resolve;
     17            iframe.src = "about:blank";
     18        });
     19 
     20        await promise_rejects_js(
     21            t,
     22            stolenTypeError,
     23            documentBeforeNav.documentElement.requestFullscreen(),
     24            "Promise should be undefined after navigation"
     25        );
     26    });
     27 </script>