tor-browser

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

subframe-painting.html (690B)


      1 <!DOCTYPE html>
      2 <body>
      3 <div id="image"></div>
      4 <script>
      5  const img = document.createElement('IMG');
      6  img.src = 'circles.png';
      7 
      8  var observer = new PerformanceObserver(function(list, obj) {
      9    var paintEntries = list.getEntries();
     10      for (let i = 0; i < paintEntries.length; i++) {
     11          // postMessage doesn't allow sending the entry object over directly
     12          var dataToSend = {
     13              "entryType": paintEntries[i]["entryType"],
     14              "name": paintEntries[i]["name"]
     15          };
     16          parent.postMessage(dataToSend, '*');
     17      }
     18  });
     19 
     20  observer.observe({"type": "paint"});
     21  document.getElementById('image').appendChild(img);
     22 </script>
     23 </body>
     24 </html>