Google Reader modifications using GreaseMonkey

Google Reader has recently received the visual update which has been available for most Google Services over the last few months. On the whole, I like the style and think it’s much cleaner than the old one. Despite this, it’s not perfect in my opinion, with my biggest complaint being how it styles the collapsed list of items. As this is the main way I consume content via Google Reader (and then click through to read the full article on the original website), it’s reduced how quickly I can scan a large list of content.

I tweeted about this frustration and a few people responded with possible suggestions (here and here), but neither was quite right for me, but it did give me an idea. If all I want to do, is change one CSS rule to reduce the height of the row, I can use the excellent GreaseMonkey extension for Firefox.

I set about learning how to make a GreaseMonkey script, and it’s incredibly simple, as it’s just plain JavaScript. Within 5 minutes I had a working script which done what I wanted.

The GreaseMonkey script can be downloaded here, and the full code is shown below. All it does is create an inline style tag in the header and add the single rule. If I was doing more complex CSS I could load an external stylesheet, but for something this simple, the overhead of an extra request wasn’t required.

// ==UserScript==
// @name           Compressed Reader
// @namespace      http://gostomski.co.uk
// @include        http://www.google.com/reader/view/
// ==/UserScript==

(function() {
var head, style;
head                   = document.getElementsByTagName('head')[0];
style                  = document.createElement('style');
style.type             = 'text/css';
style.innerHTML = "#entries.list .entry .collapsed {line-height: 2.2ex; height: 12px}";
head.appendChild(style);
})();

The above script will allow you to fit as much as 33% more posts in the screen at once.

What else would you want to change with the new Google Reader, as I may carry on developing this script to make Google Reader even better.

Leave a Reply

Your email address will not be published. Required fields are marked *