Merge pull request #66 from kherchel/fix/keybinds
Fix mute and deafen keybinds disconnecting from the call
This commit is contained in:
commit
9faabe1f3e
1 changed files with 13 additions and 6 deletions
|
@ -183,14 +183,21 @@ setInterval(() => {
|
||||||
el.appendChild(div);
|
el.appendChild(div);
|
||||||
}
|
}
|
||||||
|
|
||||||
const muteBtn = document.getElementsByClassName(
|
const buttonContainer = document.getElementsByClassName("container-YkUktl")[0];
|
||||||
|
if (!buttonContainer) {
|
||||||
|
console.log('dsa: Cannot locate Mute/Deafen/Settings button container, please report this on GitHub');
|
||||||
|
}
|
||||||
|
|
||||||
|
const muteBtn = buttonContainer ? buttonContainer.getElementsByClassName(
|
||||||
"button-12Fmur enabled-9OeuTA button-f2h6uQ lookBlank-21BCro colorBrand-I6CyqQ grow-2sR_-F"
|
"button-12Fmur enabled-9OeuTA button-f2h6uQ lookBlank-21BCro colorBrand-I6CyqQ grow-2sR_-F"
|
||||||
)[0];
|
)[0] : null;
|
||||||
window.discordScreenaudioToggleMute = () => muteBtn.click();
|
window.discordScreenaudioToggleMute = () => muteBtn && muteBtn.click();
|
||||||
const deafenBtn = document.getElementsByClassName(
|
|
||||||
|
const deafenBtn = buttonContainer ? buttonContainer.getElementsByClassName(
|
||||||
"button-12Fmur enabled-9OeuTA button-f2h6uQ lookBlank-21BCro colorBrand-I6CyqQ grow-2sR_-F"
|
"button-12Fmur enabled-9OeuTA button-f2h6uQ lookBlank-21BCro colorBrand-I6CyqQ grow-2sR_-F"
|
||||||
)[1];
|
)[1] : null;
|
||||||
window.discordScreenaudioToggleDeafen = () => deafenBtn.click();
|
|
||||||
|
window.discordScreenaudioToggleDeafen = () => deafenBtn && deafenBtn.click();
|
||||||
|
|
||||||
if (window.discordScreenaudioResolutionString) {
|
if (window.discordScreenaudioResolutionString) {
|
||||||
for (const el of document.getElementsByClassName(
|
for (const el of document.getElementsByClassName(
|
||||||
|
|
Loading…
Reference in a new issue