1
用戶在通知彈出窗口中彈出[允許]按鈕(通知請求彈出窗口示例:http://prntscr.com/7ataxu)後,Chrome瀏覽器是否可以使用JavaScript或PHP刷新頁面或將用戶重定向到特定頁面?如何在用戶獲得Chrome瀏覽器通知後刷新或重定向用戶?
用戶在通知彈出窗口中彈出[允許]按鈕(通知請求彈出窗口示例:http://prntscr.com/7ataxu)後,Chrome瀏覽器是否可以使用JavaScript或PHP刷新頁面或將用戶重定向到特定頁面?如何在用戶獲得Chrome瀏覽器通知後刷新或重定向用戶?
https://developer.mozilla.org/en-US/docs/Web/API/notification
Notification.requestPermission(function (permission) {
// If the user accepts, let's create a notification
if (permission === "granted") {
//redirect using javascript here window.location
}
});
'window.location.assign'的JavaScript API。而所有其他'window.location'方法都可能有所幫助 - MDN Docs(https://developer.mozilla.org/en-US/docs/Web/API/Window/location) – Ifch0o1