【问题标题】:How to refresh or redirect users after they allowed to get chrome browser notifications?允许获取 chrome 浏览器通知后如何刷新或重定向用户?
【发布时间】:2015-05-29 17:11:13
【问题描述】:

是否可以在 Chrome 中使用 JavaScript 或 PHP 刷新页面或将用户重定向到特定页面,在用户按下通知弹出窗口中的 [允许] 按钮后(通知请求弹出窗口示例:http://prntscr.com/7ataxu)?

【问题讨论】:

标签: javascript google-chrome push-notification


【解决方案1】:

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
      }
    });

【讨论】:

    猜你喜欢
    • 2018-04-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-10-24
    • 1970-01-01
    • 1970-01-01
    • 2015-06-14
    • 1970-01-01
    相关资源
    最近更新 更多