Fix's toolbar button injection

This Plugin is integrated as it fix's the bug where the buttons inside the tooltip do not hide when you look in a channel where you cant talk in. making the buttons push onto the other side till you reload the chat bar. futureproof. 

This plugin is made by 0simp#2291
Full credits to them for making this possible

Signed-off-by: AvaLilac <257690424+AvaLilac@users.noreply.github.com>
This commit is contained in:
AvaLilac 2026-03-28 16:19:08 -04:00 committed by GitHub
parent 73af6e3062
commit ac1b93677c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

29
avia_core/ButtonFix.js Normal file
View file

@ -0,0 +1,29 @@
(function () {
if (window.__BUTTON_FIX__) return;
window.__BUTTON_FIX__ = true;
function uninjectButton(button){
if(button){
button.parentElement.removeChild(button)
}
}
const observer = new MutationObserver(()=>{
let balls = [];
document.querySelectorAll('div[class=\'flex-sh_0 d_flex ai_end jc_center w_42px\']').forEach(element=>{
if(element.id?.includes('avia')){
balls.push(element)
}
})
const gifSpan = [...document.querySelectorAll("span.material-symbols-outlined")]
.find(s => s.textContent.trim() === "gif");
if(!gifSpan){
balls.forEach(element=>{
uninjectButton(element)
})
}
});
observer.observe(document.documentElement, {childList: true, subtree: true })
})();