NilColor

Guess what? You're on my site!

Userscript для Fluid(ium) + GMail

with one comment

Обновился Fluid.app. Теперь он сделан на базе Fluidium. Пока это бета, но я ей пользуюсь. Минус один – бадж количества не прочитанных писем перестал показываться. Для этого нужен userscript. Вот тот, что я написал для себя:

(function () {
    setInterval(update, 5000);

    function update() {
        var links = document.getElementById('canvas_frame')
            .contentDocument.getElementsByTagName('a');
        var len = links.length;

        for (var i=0; i < len; i++) {
            var str = links[i].getAttribute('href');
            if (/#inbox$/.test(str)) {
                var matches = links[i].textContent.match(/\(([0-9]+)\)/),
                    str = '';
                if (matches && matches.length > 1) {
                    str = matches[1];
                }
                window.fluid.dockBadge = str;
            }
        }
    }
})();

Пробуйте, если что не так – дайте знать ;)

Written by NilColor

May 7th, 2010 at 3:06 pm

Posted in javascript

Tagged with , , ,

One Response to 'Userscript для Fluid(ium) + GMail'

Subscribe to comments with RSS or TrackBack to 'Userscript для Fluid(ium) + GMail'.

  1. [...] This post was mentioned on Twitter by Alexey Blinov. Alexey Blinov said: New blog post: Userscript для Fluid(ium) + GMail http://nilcolor.com/2010/05/07/userscript-for-gmail_on_fluid/ [...]

Leave a Reply