4 ms·
If you’re using uBlock Origin (and you should be), it’s easy to declutter web pages by removing unwanted elements from the DOM. I recently discovered that it c
by Anthony-G 3y ago
If you’re using uBlock Origin (and you should be), it’s easy to declutter web pages by removing unwanted elements from the DOM.
I recently discovered that it can go even further in improving the user experience: it can also be used to modify most (if not all) styles on a web page. For a good description and example use case (a “dark mode” skin for Hacker News), see https://darekkay.com/blog/ublock-website-themes/ https://darekkay.com/blog/ublock-website-themes/
- eps 3y agoThis doesn't work for many sites that use randomly generated class names and IDs. For example, it's really difficult to trim all the cruft and junk from Twitter's web interface without an userscript. With the script though it's trivial and you can also filter the feed to remove ads, suggestions, posts liked by some random people, etc.
- Anthony-G 3y agoI only modify a small number of sites that I regularly visit and so far I’ve only once come across a site with random class names and IDs (I’m guessing that’s done as a way to defeat what we’re talking about). If I remember correctly, I got around the random name problem by removing the parent element which had a defined name. I don’t visit Twitter and certainly never tried to do anything as sophisticated as what you’re describing (though it sounds like other users on this page would benefit from your userscript). I just make the sites that I regularly visit that bit easier on the eye without spending too much effort on modifying styles (I also haven’t done web development in the last 10-15 years so delving into scripts and the DOM wouldn’t be my forté).
- ecnahc515 3y agoThe popular modern css and react style frameworks use dynamically generated ids and classes so it’s not necessarily to prevent userscripts but it does make it harder to use them.