You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Safari 16 WebExtension通知问题:chrome.notifications无法使用求确认

Safari扩展通知API支持情况确认
  • 目前Safari 16及Ventura Beta版本中,确实不支持chrome.notifications或browser.notifications API。
  • Safari的WebExtensions实现虽对齐了多数Chrome/Firefox的API,但通知功能当前仅支持通过标准Notification API实现,而非扩展专属的chrome.notifications或browser.notifications。
  • 若需在Safari扩展中实现通知功能,建议替换为标准Notification API,示例代码如下:
    // 请求通知权限
    Notification.requestPermission().then(permission => {
      if (permission === 'granted') {
        // 创建并显示通知
        new Notification('扩展通知', {
          body: '这是一条来自Safari扩展的通知',
          icon: 'icon.png'
        });
      }
    });
    
  • 使用标准Notification API时,仍需在扩展的manifest.json中声明notifications权限。

内容的提问来源于stack exchange,提问作者Grzegorz Zając

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.18 12:30:58