Make browser tab flash a notification
It's not possible to change the background of a browser tab, at least not consistently across all.
As Josiah has mentioned, setInterval
can be used to create a flashing page title.
This javascript makes use of it:
var PageTitleNotification = {
Vars:{
OriginalTitle: document.title,
Interval: null
},
On: function(notification, intervalSpeed){
var _this = this;
_this.Vars.Interval = setInterval(function(){
document.title = (_this.Vars.OriginalTitle == document.title)
? notification
: _this.Vars.OriginalTitle;
}, (intervalSpeed) ? intervalSpeed : 1000);
},
Off: function(){
clearInterval(this.Vars.Interval);
document.title = this.Vars.OriginalTitle;
}
}
This can be used like:
PageTitleNotification.On("User logged out!");
See my following blog post for more info:
http://curtistimson.co.uk/js/create-a-flashing-tab-notification-page-title/
You can change the title of the page (this should also change the text in the tab).
document.title = 'New title';
Additionally you could do this in a setInterval
back and forth between the page title, and the information you are attempting to show the user. I have seen this behavior on gmail with incoming chat communication.