From 05decfbae480e6d3bb2186c4f7515a6c4f3dbc49 Mon Sep 17 00:00:00 2001 From: AvaLilac <257690424+AvaLilac@users.noreply.github.com> Date: Sat, 28 Mar 2026 18:45:02 -0400 Subject: [PATCH] changes the stoat desktop button in desktop settings to make it avia Signed-off-by: AvaLilac <257690424+AvaLilac@users.noreply.github.com> --- avia_core/aviadesktopversion.js | 39 +++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 avia_core/aviadesktopversion.js diff --git a/avia_core/aviadesktopversion.js b/avia_core/aviadesktopversion.js new file mode 100644 index 0000000..2718ab0 --- /dev/null +++ b/avia_core/aviadesktopversion.js @@ -0,0 +1,39 @@ +(function () { + if (window.__AVIA_DESKTOP_PATCH__) return; + window.__AVIA_DESKTOP_PATCH__ = true; + + const AVIA_VERSION = "1.6.0"; + + function patchButton() { + document + .querySelectorAll("a.pos_relative.gap_16px.p_13px") + .forEach(el => { + if (el.dataset.aviaPatched) return; + + const textContainer = el.querySelector("div.d_flex.flex-g_1.flex-d_column"); + if (!textContainer) return; + + const nameDiv = textContainer.querySelector("div"); + const versionSpan = textContainer.querySelector("span.lh_1rem"); + + if (!nameDiv || !versionSpan) return; + if (!nameDiv.textContent.includes("Stoat for Desktop")) return; + + const match = versionSpan.textContent.match(/Version:\s*([0-9.]+)/); + if (!match) return; + const stoatVersion = match[1]; + + el.dataset.aviaPatched = "true"; + + nameDiv.textContent = "Avia Client Desktop"; + versionSpan.textContent = `Version ${AVIA_VERSION} (Based on Stoat ${stoatVersion})`; + + textContainer.style.whiteSpace = "normal"; + textContainer.style.overflow = "visible"; + }); + } + + const observer = new MutationObserver(patchButton); + observer.observe(document.body, { childList: true, subtree: true }); + patchButton(); +})(); \ No newline at end of file