Live data from Hacker News

Twitter is using its embedded JavaScript to hide tweets that have been deleted

kevinmarks.com

61–70 of 254 posts

Re: Twitter is using its embedded JavaScript to hide tweets that have been deleted

#62
post #33

Why not just copy paste or screenshot the Tweet? It's bizarre to reference a script from twitter.com directly in your site's source code and then complain that the script is doing exactly what it is supposed to.

- copy paste the content of the tweet - meta data is lost (date and time, author, obv it is possible to copy paste the text and add links to original tweet and link to an author;

- screenshot - now you dont have to add custom styles, meta data exists, but it is not usable - you can make is to click on tweet will open a tweet, but click on tweet author will open authors profile. Also screenreaders and bots - they dont parse text from images and it is harder to make images work on smaller screens.

The solution is not as simple as - ctrl+c ctrl+v text or screenshot and call it a day. You need to consider that content will be interactive (all links should work) and accessible (for screenreaders and mobile).

___

So it is understandable why low effort approach with embedded scripts, but less secure is more popular than high effort most likely not completely working, but more secure approach.

The better way would be to use twitter api and render tweets with your own styles. Safe, accessible, interactive.

Re: Twitter is using its embedded JavaScript to hide tweets that have been deleted

#63

Isn't this the way the internet is supposed to work? If I link to a page and the page is removed, it'll not show, right? Same thing if I were to add that page as an iframe on my site. So, IMHO, the title and the post doesn't make any sense. Twitter isn't editing anyone's site. You have chosen to embed some content of Twitter on yours and it is perfectly fine if they chose to remove it.

If you link to a page, whatever text you put in as the body of the link will remain. The link itself won't go anywhere, but the content you have added to it will remain. In this case, it's as if the link text also vanished when the target page vanishes.

That would be an interesting solution to link rot, admittedly - lots of older pages which are just empty lists formerly containing links to now defunct websites!

Re: Twitter is using its embedded JavaScript to hide tweets that have been deleted

#64

Well, any third-party script that you embed on your website can edit your site and do many other nefarious things (key logging, credential stealing, ...). I never got how people can just copy/paste some random JS into their own websites (often without even using integrity tags). Social embeds in particular have turned the web into a surveillance machine for large corporations, as every FB/Twitter/Instagram/... embed…

You have to have some level of trust - our ASP.net website loads quite a few Nuget packages we regularly keep up to date. Theoretically any of them say Stripe or Paypal could add nefarious code into our site to steal a bunch of stuff - there's no practical way for us to review the source code before updating.

For Javascript if you're paranoid you can add the `integrity` attribute, and most of the time you can self host the JS although all of these come with maintenance commitments.

I think it's reasonable if you trust the source (Twitter for example) to embed their third party code.

Re: Twitter is using its embedded JavaScript to hide tweets that have been deleted

#65

I've never understood why people even wanted to use this. For the styling? So you can just copy some random stuff from Twitter and it looks like Twitter but is also interactive? Just with the Facebook like-Button, you're exposing your visitors to the tracking of Twitter. For what? Just so you can quickly copy one snippet and be done with it, instead of manually copying author name, content and link and spending 10 se…

Worse, it seems like most of the time you'd want a screenshot to preserve the original text. Which takes less styling to look right.

One small note about using a screenshot versus actual text is that a screenshot does not scale with resolution.

I think a lightly styled html box with the tweet as text would be the best of both worlds.

Re: Twitter is using its embedded JavaScript to hide tweets that have been deleted

#66

Functionality aside embedding random scripts from twitter seems like a big risk for security and privacy. At a minimum, it should probably be embedded in a sandboxed iframe. Just taking a screenshot, and linking to the tweet, seems like a more robust solution, that won't randomly stop working, and doesn't have the same privacy issues.

That said, screenshots of such things bear their own problems in terms of accessibility for screen readers and other supportive devices.

Re: Twitter is using its embedded JavaScript to hide tweets that have been deleted

#67
post #26

Earlier quoted context omitted.

There should be an HTML tag or something that downloads and embeds HTML from a remote site without scripting

Don't [i]frames solve this problem? They can use scripts, sure, but those scripts are contained and cannot reach outside their box.

A quick sandbox attribute and the scripts will be disabled: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/if...

Re: Twitter is using its embedded JavaScript to hide tweets that have been deleted

#68

I've never understood why people even wanted to use this. For the styling? So you can just copy some random stuff from Twitter and it looks like Twitter but is also interactive? Just with the Facebook like-Button, you're exposing your visitors to the tracking of Twitter. For what? Just so you can quickly copy one snippet and be done with it, instead of manually copying author name, content and link and spending 10 se…

Worse, it seems like most of the time you'd want a screenshot to preserve the original text. Which takes less styling to look right.

For Twitter specifically, a link to the tweet is much more genuine than a screenshot, as screenshots can be faked, where tweets cannot be edited

Re: Twitter is using its embedded JavaScript to hide tweets that have been deleted

#69
post #50
post #21

Earlier quoted context omitted.

Curious if there’s any reason this is of particular importance. E.g. is it bad for screen readers?

We as human beings should always strive for the better, to improve, to do the best we can within reasonable bounds. It's imo not about pettiness, finding errors of others to shame them, or holding others to a bar set too high, but rather, if we don't, we start tumbling towards lesser good things as a society and community and humans. Not to say that it's not ok do make errors (it is, and it's human), but if we spot o…

Perhaps not so relevant for a misplaced apostrophe, but language is malleable and if we were always using it 100% correctly it would never evolve.

Re: Twitter is using its embedded JavaScript to hide tweets that have been deleted

#70

Earlier quoted context omitted.

Worse, it seems like most of the time you'd want a screenshot to preserve the original text. Which takes less styling to look right.

For Twitter specifically, a link to the tweet is much more genuine than a screenshot, as screenshots can be faked, where tweets cannot be edited

For now, at least: https://twitter.com/TwitterComms/status/1511456430024364037
Post reply on HN