4
exerceo
2y

Randomly generated CSS class names make customization of sites much more difficult.

Randomized gibberish CSS class names like "r-acJ79b" are used by some sites like the new Reddit and the new Twitter web apps, which makes it impossible to customize the appearance of the site and to hide "trending" spam. The only way hide annoying and spammy page elements is through user scripts which scan the page for it every second and then hide it. But until then, it appears on screen for a short period.

I once thought this is caused by react JS, but the react JS front end of the video platform "Odysee" does not have randomized CSS class names.

Comments
  • 2
    It's an obfuscation exactly to mitigate the possibility of filtering
  • 2
    @iiii It's usually a way of not having to worry about class naming when developing and letting the computer do it for you.

    If you want to watch for the element you can use the MutationObserver API instead of polling which will probably be much better for performance.
  • 1
    Yeah man the system is holding us down ✊😭

    No ya doofuses it's for minification and a simple obfuscation to protect their proprietary code
  • 1
    XPath ftw
  • 1
    There is nothing that can be saved from MutationObserver, few lines of userscript and the more distinct selectors.
  • 0
    @ScriptCoded yeah, I know the ways of scanning the stuff, but it's still an annoying obfuscation at best
  • 0
    Even a more sophisticated CSS selector can usually help because the ad elements usually have different structure despite looking the same
  • 0
    @iiii The ways of scanning the stuff? You mean MutationObserver? That was for Op, not you
  • 0
    The main reason is probably they are using components and css modules providing encapsulation and size reduction.

    Not intentional obfuscation.
    (that would only be used for anti adblocking and not globally)

    However that being said, no shits are given about user scripts and style overrides - if that means giving up a beneficial part of your tech
  • 1
    @12bitfloat We know.

    That's why it annoys me. I should be free to block that shit.
Add Comment