SpacingBat3 / WebCord

A Discord and SpaceBar :electron:-based client implemented without Discord API.
MIT License
1.98k stars 99 forks source link

Hide buttons in discord (like the gift button) #188

Closed SpidFightFR closed 2 years ago

SpidFightFR commented 2 years ago

Is your feature request related to a problem? Please describe. Can we add an option to hide the gift button for example ?

Describe the solution you'd like A CSS modification or a button to tick, in order to hide the gift button

Describe alternatives you've considered CSS modifications.

SpacingBat3 commented 2 years ago

I've made a personal CSS for WebCord to actually implement this for myself. Moreover, some buttons should hide when WebCord detects it takes too much space in order to improve the readability on smaller window sizes. But since there's no UI for CSS modifications, you would have to find a special directory (its documented in Features.md) to actually be able to inject the CSS. This feature is considered as stable and is quite a complex way to inject CSS, replace Discord stylesheet and do it without any risk of being detected by Discord's internal scripts (e.g. via MutationObserver) unlike it is done with the other solutions (in most Discord mods or browser extensions, CSS is injected using <style> HTML element and that could trigger the MutationObserver if Discord would develop a code using this native class to prevent a specific modifications done to its site.

SpidFightFR commented 2 years ago

Nice ! Could you share that file please ? Because i tried to follow the Features.md instructions, yesterday, but it didn't work...

SpacingBat3 commented 2 years ago

Nice ! Could you share that file please ? Because i tried to follow the Features.md instructions, yesterday, but it didn't work...

/**
 * @name Nitro removal theme
 * @description Removes all "Nitro" references from Discord.
 * @author SpacingBat3 <git@spacingbat3.anonaddy.com>
 * @version 1.0.0
 */

div[aria-controls="discord-nitro-tab"],
a[href="/store"],
div[class|="buttons"] > button {
  display:none
}

Save it as *.theme.css (where * means any file name). Also remember that if you're on Windows, a file extension might be hidden and creating a new file in notepad might in reality result in creating a .txt file (i.e. *.theme.css.txt) instead (which is ignored by WebCord).

SpacingBat3 commented 2 years ago

Closed as it is not planed and everyone can fix it with just custom CSS injection.