Use our exposed versions

This commit is contained in:
Amelia Frost 2026-04-04 15:43:57 -07:00
parent e56455fbaf
commit 22785a9860
No known key found for this signature in database
2 changed files with 48 additions and 53 deletions

View file

@ -2,15 +2,15 @@
if (window.__AVIA_DESKTOP_PATCH__) return; if (window.__AVIA_DESKTOP_PATCH__) return;
window.__AVIA_DESKTOP_PATCH__ = true; window.__AVIA_DESKTOP_PATCH__ = true;
const AVIA_VERSION = "1.6.0";
function patchButton() { function patchButton() {
document document
.querySelectorAll("a.pos_relative.gap_16px.p_13px") .querySelectorAll("a.pos_relative.gap_16px.p_13px")
.forEach(el => { .forEach((el) => {
if (el.dataset.aviaPatched) return; if (el.dataset.aviaPatched) return;
const textContainer = el.querySelector("div.d_flex.flex-g_1.flex-d_column"); const textContainer = el.querySelector(
"div.d_flex.flex-g_1.flex-d_column",
);
if (!textContainer) return; if (!textContainer) return;
const nameDiv = textContainer.querySelector("div"); const nameDiv = textContainer.querySelector("div");
@ -19,14 +19,15 @@
if (!nameDiv || !versionSpan) return; if (!nameDiv || !versionSpan) return;
if (!nameDiv.textContent.includes("Stoat for Desktop")) return; if (!nameDiv.textContent.includes("Stoat for Desktop")) return;
const match = versionSpan.textContent.match(/Version:\s*([0-9.]+)/); if (!versionSpan.textContent.includes("Version:")) return;
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"; nameDiv.textContent = "Avia Client Desktop";
versionSpan.textContent = `Version ${AVIA_VERSION} (Based on Stoat ${stoatVersion})`; versionSpan.textContent = `Version ${aviaVersion} (Based on Stoat ${stoatVersion})`;
textContainer.style.whiteSpace = "normal"; textContainer.style.whiteSpace = "normal";
textContainer.style.overflow = "visible"; textContainer.style.overflow = "visible";

View file

@ -1,21 +1,16 @@
(function () { (function () {
if (window.__AVIA_VERSION_PATCH__) return; if (window.__AVIA_VERSION_PATCH__) return;
window.__AVIA_VERSION_PATCH__ = true; window.__AVIA_VERSION_PATCH__ = true;
function patchVersion() { function patchVersion() {
document document
.querySelectorAll("span.lh_1rem.fs_0\\.75rem.ls_0\\.03125rem.fw_500") .querySelectorAll("span.lh_1rem.fs_0\\.75rem.ls_0\\.03125rem.fw_500")
.forEach(el => { .forEach((el) => {
if (el.dataset.aviaPatched) return; if (el.dataset.aviaPatched) return;
const match = el.textContent.match(/Stoat for Desktop\s+([0-9.]+)/); if (!el.textContent.trim().startsWith("Stoat for Desktop")) return;
if (!match) return; const stoatVersion = window.native.versions.desktop();
const stoatVersion = match[1];
el.dataset.aviaPatched = "true"; el.dataset.aviaPatched = "true";
@ -32,9 +27,8 @@ Avia Client Desktop<br>
observer.observe(document.body, { observer.observe(document.body, {
childList: true, childList: true,
subtree: true subtree: true,
}); });
patchVersion(); patchVersion();
})(); })();