Spoofing JS's withAnimationFrame