hrvoje_hr in this case it's probably not so simple, because you likely need to run this code after the IndexPage component is rendered. Which means using the extension API to extend the component itself and add something to its config method.
Can't you achieve that just via CSS ?
For more complex logic that needs to run after a component was rendered, something like this can be used in an extension javascript:
import { extend } from 'flarum/extend';
import IndexPage from 'flarum/components/IndexPage';
app.initializers.add('your-extension-namespace', () => {
extend(IndexPage.prototype, 'config', function (isInitialized) {
if (isInitialized) {
return;
}
// Do your thing
});
});
I have shared how to run that same code without pre-compilation somewhere, but I can't find the link again. It's somewhere on the forum though. It sacrifices readability but can be injected in the footer.
Also related https://discuss.flarum.org/d/21071-how-can-i-jquery-run-every-pages-posts-homepage-etc