Search code examples
javascripthtmlcloudflarerocket-loader

Cloudflare RocketLoader onloadstart issues


Cloudflare has added the RocketLoader option which adds if (!window.__cfRLUnblockHandlers) return false; to my onloadstart.

<video id="video" onloadstart="if (!window.__cfRLUnblockHandlers) return false; this.volume=0.01" loop="">

Since it adds window.__cfRLUnblockHandlers the volume that plays is super loud when people click play. As this.volume=0.01 no longer gets detected.

I have tried a few things like adding this

var __cfRLUnblockHandlers = 1 ;

or

<script>
window.__cfRLUnblockHandlers = true;
</script>

Both do not work and cloudflare still forces __cfRLUnblockHandlers onto my onloadstart.

At the moment I am unable to turn off RocketLoader. Is there a way to fix this without changing the cloudflare settings.


Solution

  • The answer should be to disable "Rocket Loader" within the Speed / Optimization area of the CloudFlare control panel.

    If you feel that you need the performance benefits of Rocket Loader then you can also disable for areas or specific pages in the website using the "page rules" functionality of CloudFlare.