How to have a global JavaScript

Hi,
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?

muebau

Like this: https://github.com/ChristophWurst/nextcloud_sentry/blob/7f79560b73ef914236037121559368bec5094b86/appinfo/app.php#L24

Basically that will include the script on any page.