-
-
Save riceissa/43ea884fbc13aa27b2b283a556184ff8 to your computer and use it in GitHub Desktop.
| ! New version at: https://github.com/riceissa/ublock-origin-substack |
@jbm9 Thanks for the comment! I think when I made this Gist 10 months ago Substack was still using hard-coded class names, but I guess they got smarter about it... I've updated those two lines to use yours.
I've found targeting the .pencraft class is sufficient to work across a much wider range of substack websites, e.g.
##.pencraft [class*="_subscribeDialog_"]
##.pencraft [class*="_background_"]
@domdomegg If I understand your comment correctly, you're saying I can remove the list of domains and instead just add the .pencraft class. I don't want to do that because it's possible some non-Substack websites will use some of the same class names and I don't want to potentially break those sites in ways that could be hard to debug.
Yep, that is my claim. I agree there comes some risk of breaking non-substack websites, but the trade-off of having this work reliably on many different custom domains is worth it for me, and I see it as very unlikely that these specific filters match again. But fair enough not updating your overall filters, can understand this is a trade-off :)
Seems they updated the css a bit, or maybe since I'm using adguard the filters need to be different, but this works for me now:
##.pencraft [class*="subscribeDialog"]
##.pencraft [class*="background"]
@evfrenkel Thank you! They do indeed seem to have updated the CSS. I've incorporated your changes.
For anyone who subscribed to the comments in this thread: I've moved this Gist to an actual GitHub repo now, with a generation script, and cleaned out the old rules that didn't seem to do anything anymore: https://github.com/riceissa/ublock-origin-substack
FWIW, I needed to tweak a couple of these a bit to deal with the dynamically-generated class names:
Thanks for posting this, it was a great starting point!