Created
July 14, 2011 08:53
-
-
Save vasilisvg/1082124 to your computer and use it in GitHub Desktop.
Google+ unread messages userscript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This script shows a badge with the number of new messages in the dock of your Fluid instance of Google+ | |
// The count is reset when you click somewhere in the body | |
// This version of the script is written by Mathias Bynens | |
(function(window, document) { | |
var nodeList = document.getElementsByClassName('a-b-f-i a-f-i'), // live NodeList | |
fluid = window.fluid, | |
length; | |
document.onclick = function() { | |
length = nodeList.length; | |
fluid.dockBadge = ''; | |
}; | |
document.onclick(); | |
setInterval(function() { | |
var currentLength = nodeList.length; | |
if (currentLength != length) { | |
fluid.dockBadge = currentLength - length; | |
} | |
}, 13e3); | |
}(this, document)); |
// This script shows a badge with the number of new messages in the dock of your Fluid instance of Google+.
// The count is reset when you click somewhere in the document.
(function(window, document) {
var nodeList = document.getElementsByClassName('a-b-f-i a-f-i'), // live NodeList
fluid = window.fluid,
length;
document.onclick = function() {
length = nodeList.length;
fluid.dockBadge = '';
};
document.onclick();
setInterval(function() {
var currentLength = nodeList.length;
if (currentLength != length) {
fluid.dockBadge = currentLength - length;
}
}, 13e3);
}(this, document));
Untested.
Wow, thanks!
Replaced my original script with mathiasbynens one.
not detected by greasemonkey because of missing userscript jsdoc.
try adding:
// ==UserScript==
// @name Google Plus Message notification
// @description Google Plus Message notification
// @namespace plus.google.com
// @version 1.0.5
// @author vasilisvg
// @license MIT
// @released 2011-07-14
// @updated 2011-07-14
// @match *:// plus.google.com/*
// @run-at document-start
// ==/UserScript==
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This script can definitely be improved. Your help would be very much appreciated.