How to have a global JavaScript

how do I manage to “register” a piece of JavaScript present in any context of the user? My app should be able to run little pieces of JavaScript in the browser of the user even if the user is not “in my app” at that moment.

Is there a Nextcloud way to do this?


Like this:

Basically that will include the script on any page.