remove dependency on aria-label

This commit is contained in:
Malte Jürgens 2022-07-28 15:09:06 +02:00
parent 6ef16b9625
commit f5217dfdfa
No known key found for this signature in database
GPG Key ID: D29FBD5F93C0CFC3
1 changed files with 9 additions and 4 deletions

View File

@ -81,11 +81,16 @@ setInterval(() => {
}); });
hiddenElements.length = 0; hiddenElements.length = 0;
} else { } else {
for (const el of document.querySelectorAll( for (const el of [
'[aria-label="Share Your Screen"]' document.getElementsByClassName("actionButtons-2vEOUh")?.[0]?.children[1],
)) { document.querySelector(
".wrapper-3t3Yqv > div > div > div > div > .controlButton-2PMNom"
),
]) {
if (!el) continue;
if (el.classList.contains("discord-screenaudio-cloned")) continue;
el.classList.add("discord-screenaudio-cloned");
elClone = el.cloneNode(true); elClone = el.cloneNode(true);
elClone.ariaLabel = "Share Your Screen with Audio";
elClone.title = "Share Your Screen with Audio"; elClone.title = "Share Your Screen with Audio";
elClone.addEventListener("click", () => { elClone.addEventListener("click", () => {
console.log("!discord-screenaudio-start-stream"); console.log("!discord-screenaudio-start-stream");