Fix skipping to next channel not working after a Discord update (browser script)

This commit is contained in:
chylex 2022-02-12 18:35:47 +01:00
parent 9f34c9dffa
commit d362c96b80
No known key found for this signature in database
GPG Key ID: 4DE42C8F19A80548

View File

@ -297,11 +297,15 @@ var DISCORD = (function(){
if (nextChannel === null){ if (nextChannel === null){
return false; return false;
} }
else{
nextChannel.children[0].click(); const nextChannelLink = nextChannel.querySelector("a[href^='/channels/']");
nextChannel.scrollIntoView(true); if (!nextChannelLink) {
return true; return false;
} }
nextChannelLink.click();
nextChannel.scrollIntoView(true);
return true;
} }
} }
}; };