You can probably do what you want with the plugin-api. Take a look at this topic: Using the PluginAPI in Site Customizations and this file: https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/lib/plugin-api.js.es6.
Depending on what you’re trying to do, the modifyClass
or onPageChange
functions could be useful.