If you’ve been reading this blog for some time, you will no doubt know by now that I write software for a living, and that I often get annoyed at unwanted drive-by porn on Twitter. Until recently the drive-by porn hasn’t been a huge problem – it was a background annoyance and nothing more. Recently, however, Twitter has changed the way a person’s timeline is shown to automatically show a preview of images loaded to certain sites, so this issue has become more than just a nuisance for me, especially since I use Twitter at work.
I came up with a solution to this problem by writing a very simple add-on for Firefox (my browser of choice), which you can download here.
What is it?
In the simplest terms, the add-on is a type of add-on known as a “page-mod” which simply means that it modifies certain types of pages. In the case of my add-on, it will modify pages under the “twitter.com” domain, which is basically what you see in your browser when looking at Twitter. What it does is, when a Twitter page is loaded it looks for media previews and removes them, and when the page changes (Twitter loads more tweets from your feed) it has another look for more media previews and removes them too.
If you want to see the media that has been removed, incidentally, simply click on the link like the old days.
How do I install it?
I haven’t yet looked into how to get a website to install an add-on automatically (i.e as you would if you went through Firefox’s add-on page) so the process is short, but manual:
- Download the add-on from here or any of the download links on this page. When prompted, ask to save the file. You might find it easiest to save the file to the desktop.
- With Firefox open, simply drag the file “twitter-hide-media.xpi” from your desktop into any open Firefox window. You will be asked if you want to install it.
- That’s it. You might need to restart Firefox, Firefox will tell you if this is the case.
There is one really weird known issue: if you go off of your timeline and click the Home navigation button on Twitter, it doesn’t remove the media previews. There are almost certainly hundreds of use cases where it fails – I’ve not done extensive testing: it’s possibly the world’s simplest add-on for Firefox (seriously: it has more lines of code that are comments than actual code!) – but it does enough for my uses for now.
Will this be actively developed?
I have no idea.
I’m already planning on putting in whitelists and blacklists for people who you know will never post anything dodgy and people you know can’t be trusted with their image uploads. I’ll probably even add things like “default to whitelist” or “default to blacklist”. But at the end of the day I wrote this to solve a problem that I had and for the time being it solves it adequately. When it comes to supporting software, even software that’s only 11 lines of actual code long, I don’t like to make assumptions!