iframe
s.I adore a good iframe
.
They’re so elegant as a web component.
Just expose an endpoint, say https://writewithharper.com/editor
, set it up to accept some query parameters and get it hosted.
Now you can access this web-component from any page that has a loose enough Content Security Policy.
For me, that means my school assignments and other assorted documentation.
It also means that I can avoid setting up a complex build system for MDX, while still being able to include interactive components.
The example from earlier:
<iframe
src="https://writewithharper.com/editor?initialText=See, we can now embed the the Harper editor%0Arght into this document!%0A%0AIt's a little too easy."
width="100%"
height="400px"
style="border-radius:10px;border:0px"
></iframe>
One major caveat though: when we pass our arguments to the component through the query URL, this gets sent to the component’s server as well. I certainly trust the Harper website’s server, since I maintain it and the code is open source, but that isn’t always the case.
You should also probably avoid doing this too much.
Most browsers spawn a whole new process for every iframe
, so if you want things to stay snappy it is best to limit yourself to just one (maybe two) per page.
It didn't work for me, and if you reading this, it probably won't work for you either.
If there is one thing o3 is useful for, it's __finding canonical documentation for complex subjects.__
Don't believe the clickbait.