Friday, November 14, 2008

Google Reader Unread Count version 4 supports Chrome

I rewrite the Google Reader Unread Count user script to support Chrome (i.e. Chromium nightly build). And fix the bug that cannot display the '+' sign if any one single feed has more than 1000 unread items.

Get the update from http://userscripts.org/scripts/show/12601.

There is a major difference of Greasemonkey support in Firefox and Chrome. In Firefox, your user script is put in a separated context. That's why you should use unsafeWindow to refer to the webpage's context. In Chrome, otherwise, is put in same context of the webpage. This introduce name conflicts in the script. For example, I added the famous $(id) function in my script which overrides the original $ function in Google Reader and makes it broken. To solve it I put everything in my own namespace to avoid the conflict.

No comments: