5 ms·
Random tip: If you have the tamper monkey browser extension [1], you can simply add `document.querySelector('[data-testid="sidebarColumn"]').remove()` to remove
by miguelmota 7y ago
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/ https://www.tampermonkey.net/
- nihonde 7y agoDoes Twitter really publish its test selectors in production?
- jazzyjackson 7y agois 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!
- nihonde 7y agoI usually strip them out during builds that target production. They’re just noise in that environment.
- bscphil 7y agoOr 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.
- miguelmota 7y agoGreat suggestion. Didn't know that
- usonian 7y agoHave you been able to get this to work? I can't get Stylus to override any styles on the new Twitter site.
- bscphil 7y agoYep, 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.
- usonian 7y agoInteresting - 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.
- bscphil 7y agoAs 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?