Last active
January 25, 2023 14:00
-
-
Save Petschko/eede4660ead4aae7c3e4e7ec47557f23 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Discord no Block MSG | |
// @namespace https://petschko.org/discord/block/ | |
// @description Removes the message "x Blocked Message(s) - Show" from Discord-Chat | |
// @author Peter Dragicevic [[email protected]] | |
// @version 1.0.3 | |
// @encoding utf-8 | |
// @match http://discord.com/* | |
// @match https://discord.com/* | |
// @grant none | |
// ==/UserScript== | |
/** | |
* User-Script Body | |
*/ | |
(function() { | |
'use strict'; | |
//-------------------------------------------------- CSS-Area --------------------------------------------------- | |
var cssCode = 'div[class^="container-"]{ min-height: 0; } div[class^="blockedSystemMessage-"], div[class*="blockedSystemMessage-"] { display: none; }'; | |
// Finally add the Code to the Head =) | |
addCustomCSStoHeadEnd(cssCode); | |
//------------------------------------------ Lib-Function-Area ------------------------------------------ | |
/** | |
* Adds CSS-Code to the Head | |
* | |
* @param {string} cssCode - CSS-Code to add to the Head | |
*/ | |
function addCustomCSStoHeadEnd(cssCode) { | |
var cssElement = document.createElement('style'); | |
var headElement = document.getElementsByTagName('head')[0]; | |
if(headElement === undefined || headElement === null) { | |
alert('Your browser doesn\'t support this Script. (Maybe after updating it?) - HEAD-Element not found'); | |
return; | |
} | |
cssElement.innerHTML = cssCode; | |
headElement.appendChild(cssElement); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment