Skip to content

Commit

Permalink
v2.15: fixes hide server button not working after discord update
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickxchong committed Mar 28, 2021
1 parent a7a889b commit 4a97bbd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions hide-discord-sidebar.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
function hideDiscordSidebar() {
/* SERVERS */

// Select the server list element, which changes in some updates.
const guildsWrapper = document.getElementsByClassName('guildsWrapper-5TJh6A')[0]
|| document.getElementsByClassName('wrapper-1Rf91z')[0];
|| document.getElementsByClassName('wrapper-1Rf91z')[0]
|| document.getElementsByClassName('wrapper-3NnKdC')[0]
// Experimenting with document.querySelector("nav[class*=wrapper-]")
// as a general fallback to select the server list.
|| document.querySelector("nav[class*=wrapper-]");

const app = document.getElementsByClassName('base-3dtUhz')[0];

const btn = document.createElement("BUTTON");
Expand Down Expand Up @@ -99,7 +106,7 @@ function hideDiscordSidebar() {
document.onreadystatechange = function () {
if (document.readyState === "complete") {
// Check that the Discord page contains the base chat element
if(document.getElementsByClassName('base-3dtUhz')[0]) {
if (document.getElementsByClassName('base-3dtUhz')[0]) {
hideDiscordSidebar();
}
}
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Hide Discord Sidebar",
"short_name": "Hide Dis Bar",
"version": "2.14",
"version": "2.15",
"description": "Installs an unfolding sidebar for Discord channels and a button that hides/shows the Discord server list.",
"manifest_version": 2,
"permissions": ["*://*.discord.com/*", "storage", "declarativeContent"],
Expand Down

0 comments on commit 4a97bbd

Please sign in to comment.