Blocking Twitter Widgets from This Site

For quite some time, I've made an active effort to strip Twitter's third-party JavaScript for tweet embedding when embedding a tweet into any of my posts.

I'm not particularly a fan of allowing Twitter to gain more information about folks' browsing habits and don't really fancy their ability to run arbitrary JavaScript on my site. It also doesn't really provide that much extra benefit to a user, from my point of view, so I'm happy leaving it as just a <blockquote>.

However, Anna and Carol noticed that on Reader Mail: What Static Site Generator Would I Recommend? there were some issues with rendering the page, but I couldn't see it with my Firefox install.

It turns out that it was due to my various privacy-aware extensions that remove things like Twitter's widgets, so I never saw the issue on my own machines, but I had actually missed a couple of instances of the widgets on that post and one from a few years ago - woops!

I've since removed them, and to help prevent this issue in the future, I've decided to finally implement a check within my pipeline to enforce this using HTML-Proofer to ensure that I can flag up cases where I've accidentally added them and block the build if I push any posts that include the Twitter sharing widget, ensuring I can't push anything to production that includes these scripts!

Written by Jamie Tanna's profile image Jamie Tanna on , and last updated on .

Content for this article is shared under the terms of the Creative Commons Attribution Non Commercial Share Alike 4.0 International, and code is shared under the Apache License 2.0.

Tags

This post was filed under articles.

This post is part of the series nablopomo-2019.

Related Posts

Other posts you may be interested in:

Interactions with this post

Interactions with this post

Below you can find the interactions that this page has had using WebMention.

Have you written a response to this post? Let me know the URL:

Do you not have a website set up with WebMention capabilities? You can use Comment Parade.