Skip to main content
replaced http://meta.stackoverflow.com/ with https://meta.stackoverflow.com/
Source Link

Per this question: http://meta.stackoverflow.com/questions/57315/can-we-get-notification-in-the-tab-change-of-titlehttps://meta.stackoverflow.com/questions/57315/can-we-get-notification-in-the-tab-change-of-title This user script was created to help draw attention to notifications even when the tab isn't in focus. It changes the page title to include the 'unreadCount' from the Stack Exchange Super-Collider.

// ==UserScript==
// @name           SE Tab Notifier
// @namespace      http://fosco.com
// @description    Update Tab Title when Inbox has content
// @include        http://*.stackexchange.com/*
// @include        http://superuser.com/*
// @include        http://serverfault.com/*
// @include        httphttps://meta.stackoverflow.com/*
// @include        http://stackoverflow.com/*
// @include        http://stackapps.com/*
// ==/UserScript==

var script = document.createElement("script");
script.textContent = "(" + grease.toString() + ")()";
document.body.appendChild(script);

function grease()
{
    var newNotifications = $('.network-items a.js-inbox-button .unread-count');
    var newReputations = $('.network-items a.js-achievements-button .unread-count');
    
    var oldTitle = $(document).attr('title');
    
    var notifyme = function ()
    {
        var notificationCount = newNotifications.text().trim();
        var reputationCount = newReputations.text().trim();
        
        if(newNotifications.is(':visible') && newReputations.is(':visible'))
        {
            $(document).attr('title','(' + notificationCount + '/' + reputationCount + ') ' + oldTitle);
        }
        else if(newNotifications.is(':visible'))
        {
            $(document).attr('title','(' + notificationCount + ') ' + oldTitle);
        }
        else if(newReputations.is(':visible'))
        {
            $(document).attr('title','(' + reputationCount + ') ' + oldTitle);
        }
        else
        {
            //Reset back to original title if notifications have gone
            $(document).attr('title', oldTitle);
        }
    };
    window.setInterval(notifyme, 1000);
}

Per this question: http://meta.stackoverflow.com/questions/57315/can-we-get-notification-in-the-tab-change-of-title This user script was created to help draw attention to notifications even when the tab isn't in focus. It changes the page title to include the 'unreadCount' from the Stack Exchange Super-Collider.

// ==UserScript==
// @name           SE Tab Notifier
// @namespace      http://fosco.com
// @description    Update Tab Title when Inbox has content
// @include        http://*.stackexchange.com/*
// @include        http://superuser.com/*
// @include        http://serverfault.com/*
// @include        http://meta.stackoverflow.com/*
// @include        http://stackoverflow.com/*
// @include        http://stackapps.com/*
// ==/UserScript==

var script = document.createElement("script");
script.textContent = "(" + grease.toString() + ")()";
document.body.appendChild(script);

function grease()
{
    var newNotifications = $('.network-items a.js-inbox-button .unread-count');
    var newReputations = $('.network-items a.js-achievements-button .unread-count');
    
    var oldTitle = $(document).attr('title');
    
    var notifyme = function ()
    {
        var notificationCount = newNotifications.text().trim();
        var reputationCount = newReputations.text().trim();
        
        if(newNotifications.is(':visible') && newReputations.is(':visible'))
        {
            $(document).attr('title','(' + notificationCount + '/' + reputationCount + ') ' + oldTitle);
        }
        else if(newNotifications.is(':visible'))
        {
            $(document).attr('title','(' + notificationCount + ') ' + oldTitle);
        }
        else if(newReputations.is(':visible'))
        {
            $(document).attr('title','(' + reputationCount + ') ' + oldTitle);
        }
        else
        {
            //Reset back to original title if notifications have gone
            $(document).attr('title', oldTitle);
        }
    };
    window.setInterval(notifyme, 1000);
}

Per this question: https://meta.stackoverflow.com/questions/57315/can-we-get-notification-in-the-tab-change-of-title This user script was created to help draw attention to notifications even when the tab isn't in focus. It changes the page title to include the 'unreadCount' from the Stack Exchange Super-Collider.

// ==UserScript==
// @name           SE Tab Notifier
// @namespace      http://fosco.com
// @description    Update Tab Title when Inbox has content
// @include        http://*.stackexchange.com/*
// @include        http://superuser.com/*
// @include        http://serverfault.com/*
// @include        https://meta.stackoverflow.com/*
// @include        http://stackoverflow.com/*
// @include        http://stackapps.com/*
// ==/UserScript==

var script = document.createElement("script");
script.textContent = "(" + grease.toString() + ")()";
document.body.appendChild(script);

function grease()
{
    var newNotifications = $('.network-items a.js-inbox-button .unread-count');
    var newReputations = $('.network-items a.js-achievements-button .unread-count');
    
    var oldTitle = $(document).attr('title');
    
    var notifyme = function ()
    {
        var notificationCount = newNotifications.text().trim();
        var reputationCount = newReputations.text().trim();
        
        if(newNotifications.is(':visible') && newReputations.is(':visible'))
        {
            $(document).attr('title','(' + notificationCount + '/' + reputationCount + ') ' + oldTitle);
        }
        else if(newNotifications.is(':visible'))
        {
            $(document).attr('title','(' + notificationCount + ') ' + oldTitle);
        }
        else if(newReputations.is(':visible'))
        {
            $(document).attr('title','(' + reputationCount + ') ' + oldTitle);
        }
        else
        {
            //Reset back to original title if notifications have gone
            $(document).attr('title', oldTitle);
        }
    };
    window.setInterval(notifyme, 1000);
}
OP pre-approved edit in comments.
Source Link
Brock Adams
  • 13k
  • 5
  • 39
  • 64

A user scriptuserscript to update the page/tab title with the # of unread notifications

Per this question: http://meta.stackoverflow.com/questions/57315/can-we-get-notification-in-the-tab-change-of-title This user script was created to help draw attention to notifications even when the tab isn't in focus. It changes the page title to include the 'unreadCount' from the StackExchange SuperColliderStack Exchange Super-Collider.

Chrome/GreaseMonkeyGreasemonkey, Tampermonkey, and most other userscript engines

A user script to update the page/tab title with # of unread notifications

Per this question: http://meta.stackoverflow.com/questions/57315/can-we-get-notification-in-the-tab-change-of-title This user script was created to help draw attention to notifications even when the tab isn't in focus. It changes the page title to include the 'unreadCount' from the StackExchange SuperCollider.

Chrome/GreaseMonkey

A userscript to update the page/tab title with the # of unread notifications

Per this question: http://meta.stackoverflow.com/questions/57315/can-we-get-notification-in-the-tab-change-of-title This user script was created to help draw attention to notifications even when the tab isn't in focus. It changes the page title to include the 'unreadCount' from the Stack Exchange Super-Collider.

Greasemonkey, Tampermonkey, and most other userscript engines

Fixed code to work with updated class and added in reputation
Source Link
// ==UserScript==
// @name           SE Tab Notifier
// @namespace      http://fosco.com
// @description    Update Tab Title when Inbox has content
// @include        http://*.stackexchange.com/*
// @include        http://superuser.com/*
// @include        http://serverfault.com/*
// @include        http://meta.stackoverflow.com/*
// @include        http://stackoverflow.com/*
// @include        http://stackapps.com/*
// ==/UserScript==
 

var script = document.createElement("script");
script.textContent = "(" + grease.toString() + ")()";
document.body.appendChild(script);

function grease()
{
    var notifymenewNotifications = function $()
'.network-items {
a.js-inbox-button .unread-count');
    var newReputations if= ($('#portalLink'.network-items a.unreadCount')js-achievements-button .isunread-count');
    
    var oldTitle = $(':visible'document).attr('title');
 {   
    var notifyme = function ()
    {
        var xnotificationCount = $newNotifications.text(document).attrtrim('title');
        var reputationCount = newReputations.text().trim();
    var count = $('#portalLink a
        if(newNotifications.unreadCount'is(':visible') && newReputations.textis(':visible');)
        {
       var len = Math  $(document).floorattr(count'title','(' + notificationCount + '/10' + reputationCount + ') ' + oldTitle);
        }
        else if(newNotifications.is(':visible'))
        {
            $(xdocument).substringattr(0'title',len+2)'(' !=+ countnotificationCount + ') ' + oldTitle);
 {       }
        else if(newReputations.is(':visible'))
        {
            $(document).attr('title',count'(' + reputationCount + ') ' + xoldTitle);
        }
       } else
        {
            //Reset back to original title if notifications have gone
            $(document).attr('title', oldTitle);
        }
    };
    window.setInterval(notifyme, 1000);
}
// ==UserScript==
// @name           SE Tab Notifier
// @namespace      http://fosco.com
// @description    Update Tab Title when Inbox has content
// @include        http://*.stackexchange.com/*
// @include        http://superuser.com/*
// @include        http://serverfault.com/*
// @include        http://meta.stackoverflow.com/*
// @include        http://stackoverflow.com/*
// ==/UserScript==
 

var script = document.createElement("script");
script.textContent = "(" + grease.toString() + ")()";
document.body.appendChild(script);

function grease()
{
 var notifyme = function ()
 {
       if ($('#portalLink a.unreadCount').is(':visible')) {
               var x = $(document).attr('title');
               var count = $('#portalLink a.unreadCount').text();
               var len = Math.floor(count/10);
               if (x.substring(0,len+2) != count + ' ') {
                       $(document).attr('title',count + ' ' + x);
               }
       }
 };
 window.setInterval(notifyme, 1000);
}
// ==UserScript==
// @name           SE Tab Notifier
// @namespace      http://fosco.com
// @description    Update Tab Title when Inbox has content
// @include        http://*.stackexchange.com/*
// @include        http://superuser.com/*
// @include        http://serverfault.com/*
// @include        http://meta.stackoverflow.com/*
// @include        http://stackoverflow.com/*
// @include        http://stackapps.com/*
// ==/UserScript==

var script = document.createElement("script");
script.textContent = "(" + grease.toString() + ")()";
document.body.appendChild(script);

function grease()
{
    var newNotifications = $('.network-items a.js-inbox-button .unread-count');
    var newReputations = $('.network-items a.js-achievements-button .unread-count');
    
    var oldTitle = $(document).attr('title');
    
    var notifyme = function ()
    {
        var notificationCount = newNotifications.text().trim();
        var reputationCount = newReputations.text().trim();
        
        if(newNotifications.is(':visible') && newReputations.is(':visible'))
        {
            $(document).attr('title','(' + notificationCount + '/' + reputationCount + ') ' + oldTitle);
        }
        else if(newNotifications.is(':visible'))
        {
            $(document).attr('title','(' + notificationCount + ') ' + oldTitle);
        }
        else if(newReputations.is(':visible'))
        {
            $(document).attr('title','(' + reputationCount + ') ' + oldTitle);
        }
        else
        {
            //Reset back to original title if notifications have gone
            $(document).attr('title', oldTitle);
        }
    };
    window.setInterval(notifyme, 1000);
}
edited tags
Link
Tim Stone
  • 4.7k
  • 3
  • 22
  • 32
Loading
edited tags
Link
Tim Stone
  • 4.7k
  • 3
  • 22
  • 32
Loading
Rollback to Revision 2
Source Link
Fosco
  • 191
  • 1
  • 7
Loading
added 235 characters in body
Source Link
Fosco
  • 191
  • 1
  • 7
Loading
removed old download link..
Source Link
Fosco
  • 191
  • 1
  • 7
Loading
Source Link
Fosco
  • 191
  • 1
  • 7
Loading