Twitter Edits You

With all the fuss about Twitter’s promised edit button, and how they might design it, we’re missing a disturbing development — Twitter is using its embedded javascript to edit other people‘s sites.

When a site embeds a tweet like this:

the code looks like this:

<blockquote class="twitter-tweet">
<p lang="en" dir="ltr">we are working on an edit button</p>
— Twitter (@Twitter) 
<a href="https://twitter.com/Twitter/status/1509951255388504066">
April 1, 2022</a>
</blockquote> 
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8">
</script>

That widgets.js script looks for blockquotes with the class="twitter-tweet" on, and replaces them with a Twitter-branded iframe to confirm that it is a real tweet (and to encourage you to click through to Twitter).

Without the script it would look like this:

we are working on an edit button

— Twitter (@Twitter) April 1, 2022

Until recently, if the tweet or account had been deleted, then Twitter would leave the blockquote alone, so the embedded text would still show, but without Twitter’s validation.

This was by design, so that the act of quoting would still work. As Ben Ward, who wrote the original code said:

And the API documentation still says this:

However, Twitter has broken this API contract. Here’s a tweet that I deleted:

Notice that it doesn’t show as a blockquote fallback, but as an empty white blob. Twitter is not confirming the tweet, but it is erasing my citation of it.

Update

Twitter has now reverted the change. “[W]e’re rolling back this change for now while we explore different options” Twitter spokesperson Remi Duhé said according to Emma Roth of The Verge.

Before this, the tweet above looked like this:

Twitter has used its javascript to edit my webpage text. When I pointed this out to Twitter Engineering:

The response was that this was “to better respect when people have chosen to delete their Tweets”:

This is tampering with the public record. Any news article that cited a tweet from the former president, like this vox one, will now have an incoherent hole in it:

Rather than the cited text:

I don’t think Twitter should edit other people’s webpages to remove tweets that have subsequently been deleted. Do you?

Update

Mark Jaquith has a protection script that runs before Twitter’s, checks for deleted or hidden tweets and removes the class="twitter-tweet" from the blockquotes so they don’t get stomped.

I spoke to Tech News Weekly about this: