未找到 Chrome webkitNotification:缺少 api [英] Chrome webkitNotification not found : api missing

查看:25
本文介绍了未找到 Chrome webkitNotification:缺少 api的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 AngularJS 开发警报通知扩展.它从 REST api 获取警报并显示通知 (webkitNotifications).在我的笔记本电脑(我正在开发的地方)上一切都很好,但是当我筛选到我的桌面进行测试时,地狱坏了.我现在收到错误:

I am developing a alert notification extension using AngularJS. It fetches alerts from a REST api and shows noification (webkitNotifications). It was all good on my laptop (where I was developing) but hell broke when I sifted to my desktop for testing. I now get error :

ReferenceError: webkitNotifications is not defined
at chrome-extension://dncdcpdlbnnhncggaenbpknljjbmdlpo/js/background.js:156:5
at chrome-extension://dncdcpdlbnnhncggaenbpknljjbmdlpo/js/angular.min.js:72:169
at E (chrome-extension://dncdcpdlbnnhncggaenbpknljjbmdlpo/js/angular.min.js:100:258)
at E (chrome-extension://dncdcpdlbnnhncggaenbpknljjbmdlpo/js/angular.min.js:100:258)
at E (chrome-extension://dncdcpdlbnnhncggaenbpknljjbmdlpo/js/angular.min.js:100:258)
at chrome-extension://dncdcpdlbnnhncggaenbpknljjbmdlpo/js/angular.min.js:102:5
at h.$eval (chrome-extension://dncdcpdlbnnhncggaenbpknljjbmdlpo/js/angular.min.js:112:179)
at h.$digest (chrome-extension://dncdcpdlbnnhncggaenbpknljjbmdlpo/js/angular.min.js:109:268)
at h.$apply (chrome-extension://dncdcpdlbnnhncggaenbpknljjbmdlpo/js/angular.min.js:113:7)
at g (chrome-extension://dncdcpdlbnnhncggaenbpknljjbmdlpo/js/angular.min.js:72:337) angular.min.js:92

笔记本电脑:v34.0.1847.116 m

Laptop : v34.0.1847.116 m

桌面版:v35.0.1916.69 beta-m

Desktop : v35.0.1916.69 beta-m

推荐答案

旧的通知 API 已弃用,现在建议使用 Rich Notifications.实施非常简单,您应该不会遇到任何问题.

The old notification API has been depreciated and now, it's suggested to use Rich Notifications. The implementation is pretty easy and you shouldn't have any problems with it.

这是文档的链接:去吧!

您应该了解 Linux 版本,其中丰富的通知仅在开发频道中可用.在稳定版本中,旧 API 仍然可以访问,并且当您的扩展跨不同系统使用时可能会导致一些问题.

You should be aware of Linux version, where rich notifications are available only in dev channel. In stable version, old API is still accessible and may cause several problems when your extension will be used across different systems.

这篇关于未找到 Chrome webkitNotification:缺少 api的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆