Revision e4248bd6a97720b5a9e35e3d0ebb92a42c8c4af3 authored by Geoffrey Sneddon on 11 April 2018, 07:26:51 UTC, committed by Geoffrey Sneddon on 11 April 2018, 07:26:51 UTC
1 parent d44cd21
Raw File
subframe-sending-paint.html
<!DOCTYPE html>
<script>
  self.addEventListener('message', function(e) {
    // Send paint-timing entries upon receiving a message.
    const paintEntries = performance.getEntriesByType('paint');
    let entryContents = paintEntries.length + '';
    for (let i = 0; i < paintEntries.length; i++) {
      const entry = paintEntries[i];
      entryContents += ' ' + entry.entryType + ' '  + entry.name;
    }
    parent.postMessage(entryContents, '*');
  });
</script>
back to top