From 22785a9860166a7a75fcc09f8ddc360cae9e2716 Mon Sep 17 00:00:00 2001 From: Amelia Frost Date: Sat, 4 Apr 2026 15:43:57 -0700 Subject: [PATCH] Use our exposed versions --- avia_core/aviadesktopversion.js | 57 +++++++++++++++++---------------- avia_core/aviaversion.js | 44 +++++++++++-------------- 2 files changed, 48 insertions(+), 53 deletions(-) diff --git a/avia_core/aviadesktopversion.js b/avia_core/aviadesktopversion.js index 2718ab0..a5ad24c 100644 --- a/avia_core/aviadesktopversion.js +++ b/avia_core/aviadesktopversion.js @@ -1,39 +1,40 @@ (function () { - if (window.__AVIA_DESKTOP_PATCH__) return; - window.__AVIA_DESKTOP_PATCH__ = true; + 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; - 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 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"); - const nameDiv = textContainer.querySelector("div"); - const versionSpan = textContainer.querySelector("span.lh_1rem"); + if (!nameDiv || !versionSpan) return; + if (!nameDiv.textContent.includes("Stoat for Desktop")) return; - if (!nameDiv || !versionSpan) return; - if (!nameDiv.textContent.includes("Stoat for Desktop")) return; + if (!versionSpan.textContent.includes("Version:")) return; - const match = versionSpan.textContent.match(/Version:\s*([0-9.]+)/); - if (!match) return; - const stoatVersion = match[1]; + const aviaVersion = window.native.versions.aviaClient(); + const stoatVersion = window.native.versions.desktop(); - el.dataset.aviaPatched = "true"; + el.dataset.aviaPatched = "true"; - nameDiv.textContent = "Avia Client Desktop"; - versionSpan.textContent = `Version ${AVIA_VERSION} (Based on Stoat ${stoatVersion})`; + nameDiv.textContent = "Avia Client Desktop"; + versionSpan.textContent = `Version ${aviaVersion} (Based on Stoat ${stoatVersion})`; - textContainer.style.whiteSpace = "normal"; - textContainer.style.overflow = "visible"; - }); - } + 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 + const observer = new MutationObserver(patchButton); + observer.observe(document.body, { childList: true, subtree: true }); + patchButton(); +})(); diff --git a/avia_core/aviaversion.js b/avia_core/aviaversion.js index 25d6885..a22e190 100644 --- a/avia_core/aviaversion.js +++ b/avia_core/aviaversion.js @@ -1,40 +1,34 @@ (function () { + if (window.__AVIA_VERSION_PATCH__) return; + window.__AVIA_VERSION_PATCH__ = true; - if (window.__AVIA_VERSION_PATCH__) return; - window.__AVIA_VERSION_PATCH__ = true; + function patchVersion() { + document + .querySelectorAll("span.lh_1rem.fs_0\\.75rem.ls_0\\.03125rem.fw_500") + .forEach((el) => { + if (el.dataset.aviaPatched) return; - function patchVersion() { + if (!el.textContent.trim().startsWith("Stoat for Desktop")) return; - document - .querySelectorAll("span.lh_1rem.fs_0\\.75rem.ls_0\\.03125rem.fw_500") - .forEach(el => { + const stoatVersion = window.native.versions.desktop(); - if (el.dataset.aviaPatched) return; + el.dataset.aviaPatched = "true"; - const match = el.textContent.match(/Stoat for Desktop\s+([0-9.]+)/); - - if (!match) return; - - const stoatVersion = match[1]; - - el.dataset.aviaPatched = "true"; - - el.innerHTML = ` + el.innerHTML = ` Avia Client Desktop
Based on Stoat ${stoatVersion} `; - }); - } + }); + } - const observer = new MutationObserver(patchVersion); + const observer = new MutationObserver(patchVersion); - observer.observe(document.body, { - childList: true, - subtree: true - }); - - patchVersion(); + observer.observe(document.body, { + childList: true, + subtree: true, + }); + patchVersion(); })();