Cloudflare Workers HTML Rewriter example Injects a <script></script> just before the end of the <body></body> with javascript that uses setTimeout() to schedule a page refresh.