Can you describe your use case in more details?
If you want to extend the page of the single page application, you should use Mithril components and our API https://docs.flarum.org/extend/frontend
If you want to integrate an existing library that manipulates the DOM, there are various Mithril hooks you can use to modify content outside of virtual DOM templates. Each component has hooks, so you need to first identify which component contains the content you are trying to modify as it will be more reliable when extending a specific component.
If you are just trying to load a different script that doesn't interact with the single page app, there are ways to inject HTML in various places in the HTML templates both above or below Flarum's own scripts.