Hacker News new | past | comments | ask | show | jobs | submit login

Random tip: If you have the tamper monkey browser extension [1], you can simply add `document.querySelector('[data-testid="sidebarColumn"]').remove()` to remove the second sidebar on page load to make it feel minimal without much effort.

[1] https://www.tampermonkey.net/




Or you can just do this in Stylus:

    div[data-testid="sidebarColumn"] {
        display: none;
    }
Also, since Tampermonkey is closed source, it's probably better to use Greasemonkey or Violentmonkey.


Have you been able to get this to work? I can't get Stylus to override any styles on the new Twitter site.


Yep, it's working for me now. Latest Firefox on MacOS. Maybe check if the "test" CSS class appears in the source for you. If not there's probably an obfuscated class you can target instead.


Interesting - this works just fine in Firefox, but the same styles in the Stylus extension for Chrome aren't working. I can see them in the DOM, they just aren't having any effect on the page. I've tried targeting both the testid and the classes and neither seem to work on Chrome.


As I recall Twitter has some fairly strict CSP rules, and extensions have had problems with them in the past. Maybe the Stylus extension can bypass rules in Firefox that it's not able to in Chrome?


Great suggestion. Didn't know that


Does Twitter really publish its test selectors in production?


is there a good reason that this would be bad practice? it's much more friendly to the end user than uglifying your html with randomly generated ids on every div!


I usually strip them out during builds that target production. They’re just noise in that environment.




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: