I need to send a message on a page from the notification window. How to do it I have the following page
var shownotif=0;
Set notification permissions for this page Show HTML Notification document.querySelector('#request_permission').addEventListener('click', function() {
window.webkitNotifications.requestPermission(); }, false);
if (window.webkitNotifications.checkPermission() == 0) {
notif=window.webkitNotifications.createHTMLNotification(url);
notif.addEventListener('display', function() {
}
);
notif.addEventListener('click', function(g, g2) {
setTimeout("tkfnm",1000);
alert(jQuery.cookie("ca2"));
}
);
notif.show();
} else {
alert("This page doesn't have permission to show notifications yet.");
} }, false);
I want that when a user clicks on the "parent" in the notification window, send my message with my information.
source
share