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:
parent
73af6e3062
commit
ac1b93677c
1 changed files with 29 additions and 0 deletions
29
avia_core/ButtonFix.js
Normal file
29
avia_core/ButtonFix.js
Normal 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 })
|
||||
})();
|
||||
Loading…
Add table
Reference in a new issue