Remove Discord Bar

N/A

当前为 2025-03-25 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 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.');
  }

});