Chris and Stephen talk about how we use a Cloudflare Worker & HTMLRewriter to inject a very special <script> tag into the previews of the Pens you work on. This script has a lot of important jobs so it’s presence is crucial, and getting it in there reliably can is a bit of a challenge.

Time Jumps

  • 00:06 Injecting a script into your code
  • 01:10 What we talked about previously that led up to this
  • 02:45 What are the jobs of this script?
  • 07:54 How do we account for HTML pages?
  • 10:22 Preview page address
  • 20:02 How do we get the script in?

Video