I don't understand your question. You don't need to hack everything with Javascript though, you can use CSS in most cases.
#app.scrolled .alt-home-link a {
width: 36px;
height: 36px;
background: url(/images/icon36x36.png) top left/contain no-repeat;
}
If that's what you mean? I add my own class "scrolled-title" so I have more precise control over when the scrolled CSS triggers, but if you can't code it yourself you probably are best off just using the supplied .scrolled class on the app div and going from there. If you're not careful with Javascript you'll end up introducing unwanted bugs - that's why for example I removed the homeLink.setAttribute("id","alt-home-link")
because that will break the code the moment you let the app navigate into a new page, you'd have to do this...
function setheaderlink(){
let homeLink;
try{
homeLink=document.getElementById("home-link");
}
catch{
homeLink=document.getElementById("alt-home-link");
}
homeLink.setAttribute("href","https://example.com/");
homeLink.setAttribute("id","alt-home-link");
}
let appFlarum=document.getElementById("app"),ob=new MutationObserver(function(){setheaderlink();});
ob.observe(appFlarum,{attributes:true,attributeFilter:["class"]});