3
var notification = new Notification(theTitle, options);
notification.onclick = function() { 
    window.location.href = theLink; //redirects to the specified link
};

I am trying to open a new tab by clicking the notification box. Using the above code the redirection works fine. But I want to open the link in a new tab. How Can I do this?

2 Answers2

5
notification.onclick = function() { 
    window.open(theLink);
};
Donald Wu
  • 698
  • 7
  • 20
3

try window.open("page url") hope it works

Saurabh Gupta
  • 122
  • 2
  • 12