Stack Apps is a question and answer site for apps, scripts, and development with the Stack Exchange API. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top


Per this question: 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
// @description    Update Tab Title when Inbox has content
// @include        http://**
// @include*
// @include*
// @include*
// @include*
// @include*
// ==/UserScript==

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

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(':visible') &&':visible'))
            $(document).attr('title','(' + notificationCount + '/' + reputationCount + ') ' + oldTitle);
        else if(':visible'))
            $(document).attr('title','(' + notificationCount + ') ' + oldTitle);
        else if(':visible'))
            $(document).attr('title','(' + reputationCount + ') ' + oldTitle);
            //Reset back to original title if notifications have gone
            $(document).attr('title', oldTitle);
    window.setInterval(notifyme, 1000);




Greasemonkey, Tampermonkey, and most other userscript engines


gfosco AT gmail

share|improve this question
I have some trouble make this script run. I have installed tampermonkey extension for chrome as recommended here…. I have copy paste the script above but it isn't working. Also I would like to add in @include but I don't understand where I am suppose to add the *. Thanks a lot! – Enora Nedelec Oct 9 '14 at 10:30
@fosco I've made a fix to this one to get it working and added in rep as well as notifications, want me to post my changes as an edit? – DavidG Oct 21 '14 at 22:12
Sure @DavidG go for it. – Fosco Oct 22 '14 at 4:28
@Fosco Done, don't mind if you reject/edit btw. May also be worth mentioning that this works with Chrome/TamperMonkey too. – DavidG Oct 22 '14 at 8:34

You must log in to answer this question.

Browse other questions tagged .