I am implementing desktop notifications in a website which displays notifications when new messages arrive. I want the browser tab in which the site is open to get focus when the user clicks on the notification & I could get this worked in Chrome with the following code:
var n = new Notification('Title', {
'body': 'Sample content.'
});
n.onclick = function (e) {
window.focus();
};
But unfortunately, this doesn't work in Firefox. :( Could anyone tell me what I am missing here? I am testing in Chrome 31 & Firefox 26
Thanks.