Greasy Fork is available in English.
Get our Twitter back from Elon.
I just made an update to fix that just a few minutes ago. But my code is more verbose than you code lol
It's at least smarter. A setInterval until the title isn't null is way better than just a setTimeout.
I do personally prefer just getting rid of the end entirely instead of replacing it.
I can already tell it's Twitter by the logo, and I think it looks cleaner.
The document title now keeps ending in " / X".
It wasn't easy to work out, but adding this to end works:
setTimeout(function(){
new MutationObserver(function(mutations) {
if (document.title.includes(" / X")) {
document.title = document.title.slice(0,-4);
}
}).observe(
document.querySelector('title'),
{ subtree: true, characterData: true, childList: true }
);
},1000)
No clue if this is the optimal way of doing things, but at least it's better than a setInterval loop.