Javascript 单击web推送通知-最小化选项卡
我问的是关于点击网页推送通知当我最小化浏览器时,它会打开最新的选项卡而不是目标url,但是当浏览器选项卡关闭时,它会成功工作 有没有办法解决这个问题这是点击事件的代码Javascript 单击web推送通知-最小化选项卡,javascript,firebase,push-notification,web-notifications,Javascript,Firebase,Push Notification,Web Notifications,我问的是关于点击网页推送通知当我最小化浏览器时,它会打开最新的选项卡而不是目标url,但是当浏览器选项卡关闭时,它会成功工作 有没有办法解决这个问题这是点击事件的代码 var notification = new Notification(title,options); notification.onclick = function (event) { event.preventDefault(); window.open(target
var notification = new Notification(title,options);
notification.onclick = function (event) {
event.preventDefault();
window.open(target link,"_blank");
};
setTimeout(notification.close.bind(notification), 7000);