Push-Api在Safari 16(技术预览)中仍然不支持?

发布于 2025-02-13 00:13:29 字数 638 浏览 0 评论 0 原文

我们想测试我们的Web-Push通知是否也将在Safari 16中运行。因此,我们从测试我们在MacOS Monterey上实施Web-Pushs 12.4。

我们使用此代码来检测浏览器是否支持Web-Pushes:

function WebPushSupported()
{   if (!window.Notification)
    {   return false;
    }
    
    if (!('serviceWorker' in navigator))
    {   return false;
    }
    
    if (!('PushManager' in window))
    {   return false;
    }   

    return true;
}

这在Chrome,Firefox等中效果很好,但是Safari 16在窗口中没有对象“ PushnManager”。

在Safari 16中,通过Push-API是否仍不支持Webpushes?

We want to test if our implementation of web-push notifications will run in Safari 16 as well. So we downloaded the "Safari Technology Preview" 148 from https://developer.apple.com/safari/resources/ to test our implementation of Web-Pushs on macOS Monterey 12.4.

We use this code to detect if a browser supports Web-Pushes:

function WebPushSupported()
{   if (!window.Notification)
    {   return false;
    }
    
    if (!('serviceWorker' in navigator))
    {   return false;
    }
    
    if (!('PushManager' in window))
    {   return false;
    }   

    return true;
}

This works fine in Chrome, Firefox and so on, but Safari 16 has no object "PushManager" in window.

Are WebPushes through the Push-API still not supported in Safari 16?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文