Skip to content

Instantly share code, notes, and snippets.

@TheSunCat
Last active October 30, 2024 05:38
Show Gist options
  • Save TheSunCat/58fedaa19d6154ef3e4b2b676c286906 to your computer and use it in GitHub Desktop.
Save TheSunCat/58fedaa19d6154ef3e4b2b676c286906 to your computer and use it in GitHub Desktop.
Hide all Nitro & Boost upsells in Discord!
/**
* @name Adblock for Discord
* @author TheSunCat and contributors
* @version 1.0.0
* @description We have moved to Codeberg! Follow the link below:
* @source https://codeberg.org/AllPurposeMat/Disblock-Origin
*/
#app-mount::before {
content: "The Disblock Origin theme has moved to Codeberg! Please check https://codeberg.org/AllPurposeMat/Disblock-Origin";
font-size: 1.25rem;
background-color: #dc8a78;
padding: 1rem;
}
@floriegl
Copy link

floriegl commented Jul 7, 2024

image
Can we do something about this? For me, it only randomly appears underneath the Mutual Servers/Friends Panel in the user side panel.

My best selector would be: div[class*="overlayBackground_"]:has(div[class*="premiumSubscribeButton_"])

@TheSunCat
Copy link
Author

Not sure whether or not you want to block this thing

@gBasil It is blocked on my end, unless you are seeing it elsewhere than the emoji picker popup?
image

Can we do something about this? For me, it only randomly appears.

@floriegl Hrm, it looks different on my end, so your CSS doesn't block it. Do you think we should wait for the ad to become consistent or find a way to block both now? With some quick poking I haven't found a way to consistently target my version of that upsell.

image

Also, would it be possible to have this be a UserCSS (.user.css) file, or have some sort of mirror in that format? And even with Stylus' CSP patching, @importing the raw URL doesn't work for me.

I've long wanted to move this to a proper repo on my own forge (https://git.allpurposem.at ) where I can have more/proper control over its distribution and do stuff like that. However I don't want this project to become less accessible because of it (I'd have to enable public sign-ups I guess). Another option would be to host a proper repo on an existing public free forge such as Codeberg or Sourcehut.
I am open to any ideas to get this out of GitHub in a way that is most accessible for everyone, please feel free to suggest things.

@gBasil
Copy link

gBasil commented Jul 9, 2024

It is blocked on my end, unless you are seeing it elsewhere than the emoji picker popup?

I re-pasted the script and it seems to work now. Thanks!

feel free to suggest things

I'll vote for Codeberg. Sourcehut is quite obtuse to use for those who aren't familiar with it.

@floriegl
Copy link

floriegl commented Jul 9, 2024

Do you think we should wait for the ad to become consistent or find a way to block both now? With some quick poking I haven't found a way to consistently target my version of that upsell.

Yeah, a friend of mine now also got a similar one:
image

div[class*="overlayBackground_"]:has(div[class*="contentText_"] > a[role="button"]) would be my best guess for that. But yeah, they got really annoying with that.

@LockBlock-dev
Copy link

LockBlock-dev commented Jul 29, 2024

Do you think we should wait for the ad to become consistent or find a way to block both now? With some quick poking I haven't found a way to consistently target my version of that upsell.

Yeah, a friend of mine now also got a similar one: image

div[class*="overlayBackground_"]:has(div[class*="contentText_"] > a[role="button"]) would be my best guess for that. But yeah, they got really annoying with that.

This selector does the trick on my end 👍
It can be added at the end of the "Hide Nitro upsells" category like so:

/* Friend overlay nitro upsell */
div[class*="overlayBackground_"]:has(div[class*="contentText_"] > a[role="button"])  { display: none; }

@Comeonnoob
Copy link

The "Hide Billing header and separator" isn't working, displays this and stops displaying the title of other seperators
изображение

And "Server booster profile badge" doesn't work, displays it anyway
изображение

@TheSunCat
Copy link
Author

Thanks for the report, I've gotten rid of the header hiding bit since it keeps breaking and technically there's still the Gift Inventory button. The changes are live on the Codeberg repo.

I've finished transitioning the repo to Codeberg, and you can now find it here: https://codeberg.org/AllPurposeMat/Disblock-Origin

Please be welcomed to continue discussion in an issue there!
The last version of the theme on GitHub disables the functionality and displays an orange banner explaining where it went. I know it's annoying to have to move, but using a real repo gives many benefits such as being able to use an issue tracker, commit names, and a proper readme file, and I've wanted to do this for a while.

The reason for picking Codeberg over GitHub is that Codeberg is a free forge, whereas GitHub has been making decisions (especially recently) that go against software freedom. Principally, I do not consent to an AI/LLM such as Copilot being trained on what I write and sold, laundering my code's license along the way. You can read more about reasons to leave GitHub at GiveUpGitHub.org

@LavenderAndChamomile
Copy link

How do I remove this? (marked in red)
remove

@TheSunCat
Copy link
Author

Hi! I moved the project to Codeberg. There's a merge request open to perhaps hide this, you are welcome to join the discussion: https://codeberg.org/AllPurposeMat/Disblock-Origin/pulls/4

@LavenderAndChamomile
Copy link

Hi! I moved the project to Codeberg. There's a merge request open to perhaps hide this, you are welcome to join the discussion: https://codeberg.org/AllPurposeMat/Disblock-Origin/pulls/4

Ok, thank you and will do!

@Smidgens
Copy link

How do I remove this? (marked in red) remove

I swear, it feels like Discord is adding space-hogging bloat on purpose to see what they can get away with.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment