Saturday, December 07, 2013

Blogger Themes That Break With NoScript

Blogger Themes That Break With NoScript TL;DR: here's a Blogger Feed bookmarklet to fix some blogger blogs that fail to load if you're using the Firefox add-on NoScript. Read on for the usual waffle.

I use NoScript with Firefox, and occasionally I'll find a link to a blog that just shows the NoScript icon and a handful of broken links. For example, a recent post on hacker news linked to a security blog post describing a technique to avoid using dangerous C functions with GCC. With NoScript, all I saw was the following:



This is because a new-ish Blogger theme is a big JavaScript application monstrosity that loads the text of the article via an asyncronous call, but does not gracefully degrade for those of us without scripts enabled. The owner of this particular blog has since switched from Blogger to Wordpress, so it's moot in this case.

A poster on HN wrote a bash shell script that downloads the blog, gets the corresponding feed and spits it out in HTML. This is a good idea. However I think that copying the blog link over to a terminal, running the script and then opening the resulting HTML page in the browser is a bit of a pain. Even for me.

Enter some 90s technology - the bookmarklet!

Simply drag the Blogger Feed bookmarklet onto your bookmark toolbar, or right click it and save as a bookmark. Next time you are faced with a NoBlog you just click the button or bookmark and it'll take you straight to the blog's JavaScript-free RSS feed version of the post. I imagine that this will work until Google shuts down Blogger and tries to force us all onto Google+.

In addition, if you want to have an icon for the bookmarklet, here's a tip cribbed from this superuser post:
  1. Find a regular link (without JavaScript) for the website with the favicon you want.
  2. Add that link to your bookmarks toolbar as a regular bookmark.
  3. Finally, change the properties of the bookmark you just added and change the location to be the actual JavaScript bookmarklet you want (you want the location from the bookmarklet that doesn't have the favicon).
These steps turn the bookmark from step 2 into a bookmarklet with the desired favicon and JavaScript. Here's a capture of the bookmarklet with the Blogger icon that I use:




Sadly, if the Blogger blog uses a Feedburner RSS redirect, then this trick doesn't work. However if that's the case then you're probably better off not reading their particular brand of propaganda anyway.

No comments:

Post a comment

Note: only a member of this blog may post a comment.