Skip to content

Commit

Permalink
mainWindow: fix for canary class changes
Browse files Browse the repository at this point in the history
  • Loading branch information
CanadaHonk authored Oct 25, 2023
1 parent 8522065 commit eee9bab
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/mainWindow.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,21 @@ const themesync = async () => {

// Settings injection
setInterval(() => {
const host = [...document.querySelectorAll('[class*="info-"] [class*="line-"]')].find(x => x.textContent.startsWith('Host '));
const host = [...document.querySelectorAll('[class*="sidebar"] [class*="info"] [class*="line"]')].find(x => x.textContent.startsWith('Host '));
if (!host || document.getElementById('openasar-ver')) return;

const oaVersion = host.cloneNode(true);
oaVersion.id = 'openasar-ver';
oaVersion.textContent = 'OpenAsar <channel> ';
oaVersion.onclick = () => DiscordNative.ipc.send('DISCORD_UPDATED_QUOTES', 'o');

const oaHash = document.querySelector('[class*="versionHash-"]').cloneNode(true);
const oaHash = document.querySelector('[class*="versionHash"]').cloneNode(true);
oaHash.textContent = '(<hash>)';
oaVersion.appendChild(oaHash);

host.insertAdjacentElement('afterend', oaVersion);

let advanced = document.querySelector('[class*="socialLinks-"]').parentElement.querySelector('[class*="header"] + [class*="item"] + [class*="item"] + [class*="item"] + [class*="item"] + [class*="item"] + [class*="item"] + [class*="item"] + [class*="item"] + [class*="item"]');
let advanced = document.querySelector('[class*="socialLinks"]').parentElement.querySelector('[class*="header"] + [class*="item"] + [class*="item"] + [class*="item"] + [class*="item"] + [class*="item"] + [class*="item"] + [class*="item"] + [class*="item"] + [class*="item"]');
if (!advanced || document.getElementById('openasar-item')) return;
if (advanced.nextSibling.className.includes('item')) advanced = advanced.nextSibling;

Expand Down Expand Up @@ -83,4 +83,4 @@ const optimize = orig => function(...args) {
if ('<domopt>' === 'true') {
Element.prototype.removeChild = optimize(Element.prototype.removeChild);
// Element.prototype.appendChild = optimize(Element.prototype.appendChild);
}
}

0 comments on commit eee9bab

Please sign in to comment.