long-pointerdown.html (662B)
1 <!DOCTYPE html> 2 <head> 3 <script src="utils.js"></script> 4 <style> 5 body { 6 width: 200px; 7 height: 200px; 8 } 9 10 * { 11 user-select: none; 12 } 13 </style> 14 <body> 15 <script> 16 document.body.addEventListener("pointerdown", () => { 17 busy_wait(120) 18 }); 19 new PerformanceObserver(entries => { 20 if (entries.getEntries().some( 21 e => e.scripts.some(script => script.invoker === "BODY.onpointerdown"))) { 22 window.parent.postMessage("FRAME", "*"); 23 } 24 }).observe({type: "long-animation-frame"}); 25 </script> 26 </body>