I created a desktop notification with window.webkitNotifications.createNotification(). I saw that gmail uses the onclick event in the notification to redirect, how is this done?
window.webkitNotifications.createNotification()
I found a solution:
var notification = window.webkitNotifications.createNotification(url,title,teaser); notification.onclick = function(x) { window.focus(); this.cancel(); $(location).attr('href',path);}; notification.show();
Source: https://habr.com/ru/post/1792842/More articles:How to get JavaScriptSerializer to treat a sub-object like a regular old string? - jsonJavascript localization in .net - javascriptPerl autosplit function with in-place editing - perlTextView html formatting - androidget parameter value from cookie - javascriptThe easiest way to get cookie value in javascript is javascriptFormatting javascript Visual Studio .NET 2010 - javascriptHow to display a PDF file? - androidPrevious and Next buttons are displayed on new lines using jQuery UI datepicker - jqueryUsing AJAX web services directly - javascriptAll Articles