file_sync_xhr_nested_helper.html (778B)
1 <!DOCTYPE HTML> 2 <html> 3 <body> 4 <input /> 5 <script> 6 const input = document.querySelector("input"); 7 input.addEventListener("keydown", function() { 8 window.opener.receivedInput(); 9 window.close(); 10 }); 11 12 function startSlowXHR() { 13 setTimeout(function() { 14 input.focus(); 15 SpecialPowers.loadChromeScript(() => { 16 /* eslint-env mozilla/chrome-script */ 17 var win = Services.wm.getMostRecentBrowserWindow(); 18 EventUtils.synthesizeKey("a", {}, win); 19 }); 20 21 var xhr = new XMLHttpRequest(); 22 xhr.open("GET", "slow.sjs", false); 23 xhr.send(null); 24 window.opener.childXHRFinished = true; 25 }, 0); 26 } 27 28 </script> 29 </body> 30 </html>