Hey there! I’m running a Discourse-hosted Discourse instance (business plan, not enterprise), and wanted to embed a Runkit widget in a post. Do you know whether this is possible? Thanks!
Technically this is possible with a theme component that decorates posts, you would then define a
[wrap] section for the embed and on post decoration load up the library and do the embedding stuff.
I would recommend quite a bit of caution here:
- You don’t want to invalidate your CSP, so you would have to consider this
- You do not want to slow down Discourse due to loading some big dynamic JS payload
I would estimate building something here would take 1-2 days of work. If you have budget perhaps open a topic on #marketplace ? Theme components can be installed fine on our business plan setups.
Thanks to the oEmbed standard, you can add
https://runkit.com/ to the setting
allowed iframes and call it a day.
Just paste a runkit URL in a line by itself and Discourse will work it’s magic:
It does becomes weird when the embed is too long, so a theme-component to help decorate (and scroll) embeds may be needed indeed.
Thanks a lot for your replies! @sam Runkit runs code server-side on their end, not client-side, so it’s rather safe (it may slow down loading due to the loading of the widget itself, but that’s it).
@Falco I had totally missed the
allowed iframes setting. As soon as I set it, it started working like a charm! I’ll see what I can do regarding the team component
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.