Remove Discord Bar

N/A

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Remove Discord Bar
// @namespace    http://tampermonkey.net/
// @version      2025-03-25
// @description  N/A
// @author       Integrace
// @match        https://discord.com/channels/*
// @icon         https://i.imgur.com/LX4MpWZ.png
// @grant        none
// @license MIT

// ==/UserScript==

function waitForElement(selector, callback) {
  const interval = setInterval(() => {
    const element = document.querySelector(selector);
    if (element) {
      clearInterval(interval);
      callback(element);
    }
  }, 100);
}


waitForElement('.bar_c38106', (contentArea) => {

  contentArea.style.marginTop = '0px';

  //First remove the contents of the "bar"
  const uselessBar = document.querySelector('.bar_c38106');
  if (uselessBar) {
    uselessBar.style.display = 'none';
    console.log('Success! The useless bar is now hidden.');
  } else {
    console.log('R.I.P. The useless bar element was not found.');
  }

  //Then resize the page
  const baseContainer = document.querySelector('.base_c48ade');
  if (baseContainer) {
    baseContainer.style.gridTemplateRows = 'auto';
    console.log('Success! The layout has been resized.');
  } else {
    console.log('R.I.P. The layout element was not found.');
  }

});