tor-browser

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

url_xmlhttprequest_img.html (844B)


      1 <!DOCTYPE html>
      2 <html class="reftest-wait">
      3 <meta charset="utf-8">
      4 <title>FileAPI Test: Creating Blob URL via XMLHttpRequest as image source</title>
      5 <link rel="author" title="Intel" href="http://www.intel.com">
      6 <link rel="author" title="JunChen Xia" href="mailto:xjconlyme@gmail.com">
      7 <link rel="match" href="url_xmlhttprequest_img-ref.html">
      8 
      9 <p>Test passes if there is a filled blue square.</p>
     10 
     11 <p>
     12  <img id="fileDisplay">
     13 </p>
     14 
     15 <script src="/common/reftest-wait.js"></script>
     16 <script>
     17  var http = new XMLHttpRequest();
     18  http.open("GET", "/images/blue96x96.png", true);
     19  http.responseType = "blob";
     20  http.onloadend = function() {
     21    var fileDisplay = document.querySelector("#fileDisplay");
     22    fileDisplay.src = window.URL.createObjectURL(http.response);
     23    fileDisplay.onload = takeScreenshot;
     24  };
     25  http.send();
     26 </script>
     27 </html>