tor-browser

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

test_pdf.html (986B)


      1 <!DOCTYPE html>
      2 <html>
      3 
      4 <head>
      5  <meta charset="utf-8">
      6  <title>PDFjs: Load a PDF in an iframe.</title>
      7  <script src="/tests/SimpleTest/SimpleTest.js"></script>
      8  <script src="/tests/SimpleTest/EventUtils.js"></script>
      9  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
     10 </head>
     11 
     12 <body>
     13  <pre id="test">
     14        <script type="text/javascript">
     15          "use strict";
     16 
     17          async function test() {
     18            await SpecialPowers.pushPrefEnv({
     19              "set": [["pdfjs.disabled", false]],
     20            });
     21 
     22            const iframe = document.createElement("iframe");
     23            document.body.append(iframe);
     24            iframe.src = "file_pdfjs_test.pdf";
     25            iframe.onload = async () => {
     26              ok(true);
     27              SimpleTest.finish();
     28            };
     29          }
     30 
     31          window.onload = () => {
     32            SimpleTest.waitForExplicitFinish();
     33            test();
     34          };
     35        </script>
     36    </pre>
     37 </body>
     38 
     39 </html>