audioworkletprocessor-recursion.html (514B)
1 <!DOCTYPE html> 2 <html class="reftest-wait"> 3 <script type="worklet"> 4 function recursive(a) { 5 if(a < 0) return 0; 6 return recursive(a - 1); 7 } 8 recursive(2400); 9 </script> 10 <script> 11 var ac = new AudioContext(); 12 var e = document.querySelector("script[type=worklet]"); 13 var text = e.innerText; 14 const blob = new Blob([text], { type: "application/javascript" }); 15 var url = URL.createObjectURL(blob); 16 17 ac.audioWorklet.addModule(url).then(() => { 18 document.documentElement.removeAttribute("class"); 19 }); 20 </script> 21 </html>