I don't know what you mean. If your extension used innerHTML to insert scripts, you need to use something else. I think that Flarum uses Mithril.js but I don't know anything about it. You should create a new thread for it, Flarum probably already has an API for displaying posts.