Desktop notifications for queue items I wasn't satisfied with Simon's alert on the orange alert. I wanted to know if even 1 review item was available, so I made some modifications to the userscript so that it runs on the Review page, and only alerts you when there are reviews that show a positive number.  

This is Simon's version, and here is my version:

/** @preserve
// ==UserScript==
// @name Review Queue Notification
// @author Malachi Edited Simon Forsberg Created
// @description Shows a desktop notification when there review items in the queue.
// @namespace https://github.com/Zomis/SE-Scripts
// @grant GM_getValue
// @grant GM_setValue
// @grant GM_notification
// @match *://*.stackexchange.com/review*
// @match *://*.stackoverflow.com/review*
// @match *://*.superuser.com/review*
// @match *://*.serverfault.com/review*
// @match *://*.askubuntu.com/review*
// @match *://*.stackapps.com/review*
// @match *://*.mathoverflow.net/review*
// ==/UserScript==
*/

var KEY_NEXT = 'NextReload';
var DELAY = 60 * 1000; //60,000 milliseconds
var currentTime = Date.now ? Date.now() : new Date().getTime();
var lastTime = GM_getValue(KEY_NEXT, 0);
var nextTime = currentTime + DELAY;
GM_setValue(KEY_NEXT, nextTime);

var timeDiff = Math.abs(lastTime - currentTime);
setTimeout(function(){
    window.location.reload(); 
}, DELAY);

var title = document.title.split(' - '); // keep the site name
document.title = 'Desktop Notifications - ' + title[1];

// a way to detect that the script is being executed because of an automatic script reload, not by the user.
if (timeDiff &lt;= DELAY * 2) {
    var notifications = [];

    var reviewCount = 0;
    var reviewItems = document.getElementsByClassName('dashboard-num');

    for (var i = 0; i &lt; reviewItems.length; i++){
        reviewCount += parseInt((reviewItems[i].getAttribute("title")).replace(',',''), 10);
        console.log(reviewItems[i]);
    }
    console.log(reviewCount);
    if (reviewCount &gt; 0) {
        notifications.push(reviewCount + ' Review Items');
    }

    if (notifications.length) {
        var details = {
            title: document.title,
            text: notifications.join('\n'),
            timeout: 0
        };
        GM_notification(details, null);
    }
}




This is also available on my GitHub as a userscript.

Follow-up question with new GitHub repo
This is mostly personal preference, but, I usually stack the @matches  in descending size:


// @match *://*.stackexchange.com/review*
// @match *://*.stackoverflow.com/review*
// @match *://*.superuser.com/review*
// @match *://*.serverfault.com/review*
// @match *://*.askubuntu.com/review*
// @match *://*.stackapps.com/review*
// @match *://*.mathoverflow.net/review*



into:

// @match *://*.stackexchange.com/review*
// @match *://*.stackoverflow.com/review*
// @match *://*.mathoverflow.net/review*
// @match *://*.serverfault.com/review*
// @match *://*.askubuntu.com/review*
// @match *://*.stackapps.com/review*    
// @match *://*.superuser.com/review*


Just looks nicer, I suppose.



var title = document.title.split(' - ');:

You don't use title for anything other than title[1], so just use var title = document.title.split(' - ')[1] instead.



.replace(',',''): You should have a space after ','.



You could consider replacing the .length style for loop with a for (var i in reviewItems) style loop. If not, you can also declare reviewCount in the for loop like: for (var reviewCount = 0, i = 0;.



var details = {
        title: document.title,


Desktop Notifications - Code Review Stack Exchange sounds a little bulky and over-the-top. Review Items is a better name for it, and you could consider removing Stack Exchange, but, consider the effect that would have on MSE.



I can't see the point in using notifications as an array, as it should really just have the one notification.


if (reviewCount &gt; 0) {
    notifications.push(reviewCount + ' Review Items');
}
if (notifications.length) {
    var details = {
        text: notifications.join('\n'),



if (reviewCount &gt; 0) {
    notification = reviewCount + ' Review Items';
}
if (notification) {
    var details = {
        text: notification,


or even just move reviewCount + ' Review Items' into details, like:

if (reviewCount &gt; 0) {
    var details = {
        text: reviewCount + ' Review Items',




As of ECMAScript 5, the default radix used in parseInt is supposed to be \$10\$, before that, \$0\$ would get parsed as a octal number instead of a decimal number, and, as it seems, you can just omit that optional radix argument entirely. Although, as @EthanBierlein pointed out in the comments; MDN recommends not to omit it.