Hacker News new | ask | show | jobs
by takeout 2531 days ago
As for obfuscated CSS classes, this is likely to use scoped CSS, which allows for components to share class names but not share class attributes.

That's kind of against the point of CSS, but it's also a useful dev tool to make your code more readable. I agree that it can be annoying on the user side, but it makes sense that they made this change.

Also, most likely, these change every deploy (when the depedency manager builds the app).

2 comments

It's definitely done to obfuscate as well - I took a look a while back and they were intentionally splitting up things like the "Sponsored" text into tons of tags and gunk to make it harder to find programmatically.
That was facebook
I'm sure it is possible they are doing it as well, but I was talking about what I saw on twitter's new design. I don't use Facebook, so it was definitely Twitter I saw. This was a while back, so potentially it isn't the case any more.
I think it's more likely that this is a user-hostile feature to prevent scraping or styling scripts that might mess with ad views.
I really, really doubt that. At worst, it's both. CSS scoping and obfuscated class names are really popular and part of any modern JS framework.
I wrote an open source application that uses Webdriver to scrape tweets; it used to show how heavily Twitter censors all kinds of users. Twitter used to have a tweet's "quality" (per them) right in the HTML: "HighQuality", "LowQuality", and "AbusiveQuality". They put some tweets in the "tombstone" section. I now need to change the app to deal with them obfuscating the "quality" and all the rest.

I've run a Twitter ad for the app so at least someone there knows about it. I don't know if the app was a factor, but certainly hiding what they think of their users' output is in line with all the other sneaky things they do to their users.

It's certainly not the primary driver. Twitter is built using React Native for Web, which uses a pattern called "Atomic CSS".[1] So it's just a result of the framework they're using.

[1] https://github.com/necolas/react-native-web/blob/master/docs...