Last active
June 7, 2018 02:05
-
-
Save PullJosh/849547df25436e23adc0 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// ==UserScript== | |
// @name Scratch Messages in Title | |
// @version 0.1 | |
// @description Updates the page title to show number of messages (updates every 5 seconds) | |
// @match http://scratch.mit.edu/* | |
// @copyright 2014, Josh Pullen | |
// ==/UserScript== | |
var basetitle = document.getElementsByTagName("title")[0].innerHTML; | |
setInterval(function(){ | |
if (parseInt($(".notificationsCount").html()) == 0) { | |
document.title = basetitle; | |
} else { | |
document.title = "(" + $(".notificationsCount").html() + ") " + basetitle; | |
} | |
},2000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment