revoked-blob-print.html (785B)
1 <!doctype html> 2 <html class="test-wait"> 3 <title>Printing an image with src="revoked-blob"</title> 4 <link rel="author" href="mailto:emilio@crisal.io" title="Emilio Cobos Álvarez"> 5 <link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1665343"> 6 <link rel="match" href="revoked-blob-print-ref.html"> 7 <img width=100 height=50> 8 <script> 9 let canvas = document.createElement("canvas"); 10 canvas.width = 100; 11 canvas.height = 50; 12 let ctx = canvas.getContext("2d"); 13 ctx.fillRect(0, 0, 100, 50); 14 canvas.toBlob(function(blob) { 15 let img = document.querySelector("img"); 16 let url = URL.createObjectURL(blob); 17 img.onload = function() { 18 URL.revokeObjectURL(url); 19 document.documentElement.className = ""; 20 }; 21 img.src = url; 22 }); 23 </script> 24 </html>