Today I learned: if you start a load navigation in a subframe from script before your page is done loading, Chrome and Safari will fire your page's onload before that subframe load completes.
<body> <script> var d=document var i=d.createElement("iframe") var b=new Blob(["test"],{type:"text/html"}) var url = URL.createObjectURL(b) // Order of next 2 lines matters d.body.appendChild(i) i.src=url </script> <script> onload=()=>console.log(self[0].location.href) </script>