Skip to content

Commit

Permalink
mainWindow: rewrite setting item selection and add fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
CanadaHonk committed Jan 9, 2024
1 parent 9f68f8d commit 0c497a6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/mainWindow.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ setInterval(() => {

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*="premiumTab"] ~ [class*="header"] + [class*="item"] + [class*="item"] + [class*="item"] + [class*="item"] + [class*="item"] + [class*="item"] + [class*="item"] + [class*="item"] + [class*="item"] ~ [class*="separator"]')?.previousSibling;
if (!advanced) advanced = [...document.querySelectorAll('[class*="item"]')].find(x => x.textContent === 'Advanced')
if (!advanced || document.getElementById('openasar-item')) return;
if (advanced.nextSibling.className.includes('item')) advanced = advanced.nextSibling;

const oaSetting = advanced.cloneNode(true);
oaSetting.textContent = 'OpenAsar';
Expand Down

0 comments on commit 0c497a6

Please sign in to comment.