X to Twitter

Get our Twitter back from Elon.

< Feedback on X to Twitter

Question/comment

§
Posted: 2023-07-28

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.

yakisova41Author
§
Posted: 2023-07-28

I just made an update to fix that just a few minutes ago. But my code is more verbose than you code lol

§
Posted: 2023-07-28

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.

Post reply

Sign in to post a reply.