Javascript 在允许用户获得chrome浏览器通知后,如何刷新或重定向用户?
在Chrome中,用户按下通知弹出窗口中的[允许]按钮(通知请求弹出窗口示例:)后,是否可以使用JavaScript或PHP刷新页面或将用户重定向到特定页面?Javascript 在允许用户获得chrome浏览器通知后,如何刷新或重定向用户?,javascript,google-chrome,push-notification,Javascript,Google Chrome,Push Notification,在Chrome中,用户按下通知弹出窗口中的[允许]按钮(通知请求弹出窗口示例:)后,是否可以使用JavaScript或PHP刷新页面或将用户重定向到特定页面? window.location.assignJavaScript API。以及所有其他窗口。位置方法可能会有所帮助-MDN文档() Notification.requestPermission(function (permission) { // If the user accepts, let's create a not
window.location.assign
JavaScript API。以及所有其他窗口。位置方法可能会有所帮助-MDN文档()
Notification.requestPermission(function (permission) {
// If the user accepts, let's create a notification
if (permission === "granted") {
//redirect using javascript here window.location
}
});