Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

桌面通知 chrome.notifications 需要定义权限 #15

Open
mydaoyuan opened this issue May 5, 2019 · 1 comment
Open

桌面通知 chrome.notifications 需要定义权限 #15

mydaoyuan opened this issue May 5, 2019 · 1 comment

Comments

@mydaoyuan
Copy link

mydaoyuan commented May 5, 2019

更新:

image

看了英文文档,是需要显式的声明权限的。

declare_permissions


    "permissions": [
        "notifications"
    ]

需要加入 notifications 权限,否则无法调用。报错如下。

image


加入权限后,正常调用。
image

看了文档貌似没有明确说必须赋权,声明权限

@mydaoyuan mydaoyuan changed the title 桌面通知需要加入 chrome.notifications 需要定义权限 桌面通知 chrome.notifications 需要定义权限 May 5, 2019
@mydaoyuan
Copy link
Author

mydaoyuan commented May 5, 2019

使用H5的 Notification 会没有权限, Notification.permission 默认是 defaultactive tab允许通知也无法使用 backgroundjs 发起通知,也无法使用 Notification.requestPermission 进行赋权。

版本: Chrome/73.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant