So, I have a plugin that I need to run on my site. Any sane user would use an iFrame Embed and accept the limitations of not being able to resize. But I’m not sane.
So I dove into using Custom Elements, so I learned about web components, refreshed my memory on creating dom elements, and went to town. Turns out, I needed to have the component js write the embed, rather than a simple
innerHTML = `<script>[...]</script>`
First off, it actually works. It works perfectly in preview mode- it automatically resizes based on content the plugin loads and everything!