iframe-with-fetch-variants.html (446B)
1 <!DOCTYPE html> 2 <meta charset="utf-8" /> 3 <script> 4 const url = new URL(new URLSearchParams(location.search.substr(1)).get('url'), location.href); 5 const before = performance.now(); 6 fetch(url) 7 .then(r => r.text()) 8 .then(() => 9 parent.postMessage({ 10 before, 11 after: performance.now(), 12 entry: performance.getEntriesByName(url)[0].toJSON() 13 })); 14 </script>